Skip to content

Commit

Permalink
[MAIN] Example of task creation
Browse files Browse the repository at this point in the history
  • Loading branch information
aleemont1 committed Nov 25, 2023
1 parent ec9e74a commit 18d46ae
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion smart_bridge/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
#include "Arduino.h"
#include "kernel/Scheduler.h"
#include "tasks/CheckInTask.h"

Scheduler *scheduler = new Scheduler();

void setup()
{
Serial.begin(9600);
scheduler->init(1900);
CheckInTask *checkInTask = new CheckInTask();
checkInTask->init();
checkInTask->setActive(true);

if (scheduler->addTask(checkInTask))
{
Serial.println("Task added");
}
else
{
Serial.println("Task not added");
}
}

void loop()
{

scheduler->schedule();
}

0 comments on commit 18d46ae

Please sign in to comment.