Arduino-esp32: support Scheduler library

Created on 20 Mar 2017  路  5Comments  路  Source: espressif/arduino-esp32

Is there a way to use the Scheduler library?
Would be great to have multiple tasks/loops running.
(it would be also great to have priorities too)

original source on github

Example use:

#include <Scheduler.h>

int counter = 0;
int counter1 = 0;

void setup()
{
  Scheduler.startLoop(loop1);
}

void loop () {
 analogWrite(9, counter);
 counter++;
 if (counter > 255){
  counter = 0;
 }
 delay(33);
}

void loop1 () {
 analogWrite(10, counter1);
 counter1=counter1+5;
 if (counter1 > 255){
  counter1 = 0;
 }
 delay(10);
 yield();
}

Most helpful comment

I made a little example of multiples loops , check this out: https://github.com/copercini/esp32-iot-examples/blob/master/multiloop/multiloop.ino

All 5 comments

Do tasks do what you need? You can access them from the arduino environment.

http://www.freertos.org/a00125.html

wow great - did not know, that it is accessible within arduino environment.
So Maybe I build my own helper class and using xTaskCreate and vTaskDelay

@Jorgen-VikingGod :
Did not look into it yet so this is not a comment on usability and/or quality.
https://github.com/michaelbecker/freertos-addons

I made a little example of multiples loops , check this out: https://github.com/copercini/esp32-iot-examples/blob/master/multiloop/multiloop.ino

Since the arduino core run over FreeRTOS and you can call the APIs directly in the Arduino sketch, it's not necessary an additional library

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AsafFisher picture AsafFisher  路  4Comments

DrewHoyt picture DrewHoyt  路  4Comments

mpatafio picture mpatafio  路  4Comments

paramono picture paramono  路  4Comments

Darkhub picture Darkhub  路  3Comments