setup(), loop() and the start-up order. More...
Functions | |
| void | setup (void) |
| Written by the sketch: runs once after reset, on core 0. | |
| void | loop (void) |
| Written by the sketch: runs over and over after setup(), on core 0. | |
| void | yield (void) |
| Called while delay() or USB Serial is waiting. | |
| void | init (void) |
| Core start-up, before setup(): sets the CPU speed (Tools > CPU Speed), the ADC, USB and the inter-core FIFO. | |
| void | initVariant (void) |
| Board start-up, after init(): the on-board ADC and the USB-PD controller. | |
setup(), loop() and the start-up order.
Start-up: init() (core), then initVariant() (board), then setup() once, then loop() forever. A sketch that also defines setup1() and loop1() runs them on the second core at the same time (Multicore).
| void setup | ( | void | ) |
Written by the sketch: runs once after reset, on core 0.
USB Serial is already running; add while (!Serial) {} to wait for the Serial Monitor before printing. With FreeRTOS, setup() and loop() run in a task (FreeRTOS).
| void yield | ( | void | ) |
Called while delay() or USB Serial is waiting.
Does nothing unless the sketch defines its own; with FreeRTOS, it lets other tasks of the same priority run.