Hi mate,
I have exhausted the living crap out of studying the different boards AND I CAN ADVISE YOU PRETTY RELIABLY AS FOLLOWS
1. You're a beginner , so that needs to be kept in mind
(as others have stated you don't necessarily need to use Arduino IDE for programming) now while this is correct, You should start on Arduino IDE.
2.
DECIDING WHICH BOARD TO GO FORWell, first this a question of .. What do you want to do ? However no beginner knows what they want to do , they usually just play with LED Strips for the most part , Sure, do that for a few days, then.. Move onto some more constructive that you'll actually learn from.
So as for the Boards, Your first basic choices are... Do you want to go down the Raspberry Pi road (i would advise NO unless you can give me a reason why not.
so LET'S NOW TALK ABOUT THE OTHER DEV BOARD OPTIONS
You have a lot of choice, TeensyDuino, Arduino, Uno, Nano ,Mega, micro etc etc then all the other boards out there
HERE IS THE SUMMARY
You have 2 basic choices,
ARDUINO UNO
ESP32 WROOM
THE BETTER CHOICE IS THE ESP32 WROOMThis thing is so cheap it's not funny
On top of that , You have Dual core processing (You will thank me for this later)
You can do everything that you can do on Arduino, on an ESP32 Board
You can use the same language, write the same program (Except ESP32 has some MINOR Modifications) Not a big deal, ok
3. Now you don't want to be someone that just flips through sketches and loads them all the time, You want to know how to have some basic programming skills
STEP 1 - Go to this link and the do the basic programming course with the ESP32 and Arduino IDE loaded , so you can follow along , that way you'll understand program structure
and how things work.
Start here
https://startingelectronics.org/software/arduino/learn-to-program-course/01-program-structure-flow/STEP 2 - Your basic "Bare Minimum" Code for Arduino Is going to look like this
Here is a format that i use for myself and when teaching students.
/*
GLOBAL FUNCTIONS AND VARIABLES
///////////////////////////////////////////////////////////////////////////////////////////
PROJECT INFORMATION
-------------------------------------------------------------------------------------------
CREATED BY :
CREATED BY :
DATE :
PROJECT :
VERSION :
LAST EDIT :
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
WIRING INFORMATION
-------------------------------------------------------------------------------------------
PIN # - DESCRIPTION
///////////////////////////////////////////////////////////////////////////////////////////
*/
///////////////////////////////////////////////////////////////////////////////////////////
// Libraries to include
//-----------------------------------------------------------------------------------------
//#include <LIBRARY_NAME.h> //DESCRIPTION OF LIBRARY
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// BEGIN SETUP
///////////////////////////////////////////////////////////////////////////////////////////
void setup()
{ //OPENS Void Setup
///////////////////////////////////////////////////////////////////////////////////////////
} //CLOSES Void Setup
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// BEGIN LOOP
///////////////////////////////////////////////////////////////////////////////////////////
void loop()
{ //OPENS Void Loop
///////////////////////////////////////////////////////////////////////////////////////////
} //CLOSES Void Loop
///////////////////////////////////////////////////////////////////////////////////////////
Now here is the basic structure for ESP32 (Considering that you'll now be playing with 2 Cores)
/*
GLOBAL FUNCTIONS AND VARIABLES
///////////////////////////////////////////////////////////////////////////////////////////
PROJECT INFORMATION
-------------------------------------------------------------------------------------------
CREATED BY :
CREATED BY :
DATE :
PROJECT :
VERSION :
LAST EDIT :
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
WIRING INFORMATION
-------------------------------------------------------------------------------------------
PIN # - DESCRIPTION
///////////////////////////////////////////////////////////////////////////////////////////
*/
///////////////////////////////////////////////////////////////////////////////////////////
// Libraries to include
//-----------------------------------------------------------------------------------------
//#include <LIBRARY_NAME.h> //DESCRIPTION OF LIBRARY
///////////////////////////////////////////////////////////////////////////////////////////
/*/////////////////////////////////////////////////////////////////////////////////////////
INITIATES THE TASKS
*///---------------------------------------------------------------------------------------
void Task1(void *pvParameters); //Initiates Task1
///////////////////////////////////////////////////////////////////////////////////////////
/*/////////////////////////////////////////////////////////////////////////////////////////
DEFINES THE TASK HANDLES
*///---------------------------------------------------------------------------------------
TaskHandle_t Task_1; //Handle for Task1
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// BEGIN SETUP
///////////////////////////////////////////////////////////////////////////////////////////
void setup()
{ //OPENS Void Setup
/*/----------------------------------------------------------------------------------------
//SERIAL COMMUNICATION
-------------------------------------------------------------------------------------------
Baud Rate Setup
*///---------------------------------------------------------------------------------------
Serial.begin(115200); // Serial Monitor Baud Rate
delay(10);
///////////////////////////////////////////////////////////////////////////////////////////
/*-----------------------------------------------------------------------------------------
TASK CREATION
*///---------------------------------------------------------------------------------------
xTaskCreate(Task1, "Task 1", 2000, NULL, 1, &Task_1);
vTaskDelay(100);
///////////////////////////////////////////////////////////////////////////////////////////
} //CLOSES Void Setup
///////////////////////////////////////////////////////////////////////////////////////////
/*/////////////////////////////////////////////////////////////////////////////////////////
TASK EXECUTION - TASK 1
*//////////////////////////////////////////////////////////////////////////////////////////
void Task1(void *pvParameters) //Initiates Task1
{ // OPENS Task1
Serial.print(F("TASK 1 IS RUNNING ON CORE "));
Serial.println(xPortGetCoreID());
//vTaskDelay(1000);
for(;;)
{ //OPENS Task1 FOR Loop
vTaskDelay(10); // REMOVE THIS LINE BEFORE INSERTING CODE
} //CLOSES Task1 FOR Loop
} // CLOSES Task1
///////////////////////////////////////////////////////////////////////////////////////////
void loop()
{ //OPENS Void Loop
vTaskDelay(10); // REMOVE THIS LINE BEFORE INSERTING CODE
} //CLOSES Void Loop
///////////////////////////////////////////////////////////////////////////////////////////
Possibly the best advice i can give you is when starting ESP32 everyone is going to go on about "You have to pin the task to the core" using the function "xTaskCreatePinnedToCore"
THIS IS NOT CORRECT, Just use "xTaskCreate" as i have done here, Run it and play around with the serial monitor and noting how the rules work for the cores
OK, so this will get you started and understanding the basics
NOW, YOU'RE GOING TO ACTUALLY HAVE TO READ THE FREE RTOS USERMANUAL
chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://www.freertos.org/Documentation/Mastering-the-FreeRTOS-Real-Time-Kernel.v1.0.pdfA QUICK CHEAT SHEET START
1. Jump straight to page 72 (Figure 4.7) This will explain STATES OF A TASK to you
2. Now go back to page 54 , The beginning of the chapter of TASK MANAGEMENT and go to around page 93
You'll now have a very good understanding of what you're doing
3. Now make a coffee and set aside 3 days of hard study and read the entire manual.
SO HERE IS WHY
You're going to start with LED's (usually on Arduino) and when you want to blink them, you're going to be taught to use Delay as the function and a delay will be followed by a time period of the delay. Now you'll always run into a problem BECAUSE OF HOW ARDUINO WORKS vs ESP32
the problem will be other things will be stopped and can't run until the delay time is up
The communities solution to this is to use "millis" LOL and.. for simple stuff. it works, (But then, for simple stuff, so does delay)
the point is, You're going to fail again. This is why FreeRTOS is better, You see, in ESP32 vTaskDelay does not act as BLOCKING CODE (see that diagram that i showed you)
but in Arduino it does. Write experimental code to prove this, it'll help your programming skills
Point is, ESP32 is better than Arduino
Now... To get you started, REACH OUT TO ME IF YOU HAVE ANY NEED FOR ANY OF THIS CODE
I'm going to give you a list of what i have As Test Sketches. These were all created either for educational purposes of basic test purposes
- There is something called FastLED Pragma Message, it's an error that you can ignore, but i have code that can silence it
- Arithmetic Operations - This code helps you understand Arithmetic coding
- FOR Loops - This sketch let's you play with FOR Loops and understand how they work
- Increment Operators - This sketch let's you play with incremental operators to understand how to control the variables to do what you want to do.
- Relational Operators - This sketch let's your play around with relational operators to learn how they work
- Variables
- Test 2 LED Strips - A Sketch to test 2 LED Strips if they are working or not
- Basic Printline - A Sketch to let you play with the output serial monitor for diagnostics
- FASTLED Multitasking - To be used with the FastLED library, a sketch to teach you multitasking on 1 core
- FastLED RGB Ordering - THIS ONE IS USEFUL - A Sketch that when you run it and you don't know the RGB ordering of the LED Strip that you just bought, this sketch will tell you the ordering of the strip, saves you many many hours of wondering , why is the correct colour not coming up
- FOR Loops - A Sketch to help you understand FOR Loops
- Get Core ID - A sketch to help you understand which core is currently running a task
- While For Loops - A Sketch (When you're ready and if you need to use it) that will teach you WHILE FOR loops
I won't post it all here now, but to get you doing your own code. Let me know and i'll pop it up
(Likely i'll create a new thread for it for everyone to see and you can grab the code from there.
FOR NOW MY ADVICE TO YOU IS ESP32 as a direct answer to your original question
and i wouldn't bother with those boards that you bought because those boards and arduino nano have more problems than you want to deal with
when you are starting off .