Skip to content

Commit

Permalink
[MAIN] Correct usage of Scheduler and tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
aleemont1 committed Nov 25, 2023
1 parent 032ba81 commit 75acd7f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions smart_bridge/src/main.cpp
Original file line number Diff line number Diff line change
@@ -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()
Expand Down

0 comments on commit 75acd7f

Please sign in to comment.