You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can already start without a scheduler but a RR strategy in the main loop to simplify matters (scheduler may be considered when implementing the webserver interface):
// Abstract class for TaskclassTask {
public:virtualvoidupdate() = 0;
}
...
// Classes that needs to be scheduled implements update() methodclassBeeper: publicTask {
public:voidupdate() {
// non-blocking code called from the scheduler
}
...
voidbeep(uint8_t repeats){
}
...
}
...
setup() {
// Task objects
Beeper beeper;
Knitter knitter;
Led ledA, ledB;
SerialCom serialCom;
Watchdog watchdog;
...
}
loop () {
beeper.update();
knitter.update();
ledA.update(); // blinking (vs solid) led as "firmware alive" indication
ledB.update();
serialCom.update(); // call PacketSerial.update()
watchdog.update();
...
}
It may be good to have a generic pattern for tasks like this (beeper, LEDs, watchdog, ...) including knitter, e.g.:
The text was updated successfully, but these errors were encountered: