From 75acd7f657fdb2e553189c104a6fd488a18d02f8 Mon Sep 17 00:00:00 2001 From: Alessandro Monticelli Date: Sat, 25 Nov 2023 18:02:16 +0100 Subject: [PATCH] [MAIN] Correct usage of Scheduler and tasks --- smart_bridge/src/main.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/smart_bridge/src/main.cpp b/smart_bridge/src/main.cpp index 1fecbf6..354e257 100644 --- a/smart_bridge/src/main.cpp +++ b/smart_bridge/src/main.cpp @@ -1,25 +1,25 @@ #include "Arduino.h" #include "kernel/Scheduler.h" +#include "tasks/BlinkTask.h" #include "tasks/CheckInTask.h" +#include "config/config.h" Scheduler scheduler; void setup() { Serial.begin(9600); - scheduler.init(100); + scheduler.init(500); + //NOTE: THIS IS JUST A TEST TASK + BlinkTask *blinkTask = new BlinkTask(L3_PIN); + blinkTask->init(500); + blinkTask->setActive(true); + //NOTE: THIS IS THE REAL TASK CheckInTask *checkInTask = new CheckInTask(); - checkInTask->init(2100); + checkInTask->init(); checkInTask->setActive(true); - - if (scheduler.addTask(checkInTask)) - { - Serial.println("Task added"); - } - else - { - Serial.println("Task not added"); - } + scheduler.addTask(checkInTask); + scheduler.addTask(blinkTask); } void loop()