Skip to content

Commit

Permalink
[MAIN] Clean main
Browse files Browse the repository at this point in the history
  • Loading branch information
aleemont1 committed Dec 4, 2023
1 parent c5c93c6 commit 2f8bb18
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions smart_bridge/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
#include "tasks/CheckOutTask.h"
#include "tasks/CountDown.h"
#include "tasks/WaitForClickTask.h"
#include "tasks/WashingTask.h"
#include "tasks/CheckOutTask.h"
#include "tasks/ExitTransitTask.h"
#include "tasks/TemperatureTask.h"

// #include "tasks/ServoTestTask.h"

Scheduler scheduler;
Expand All @@ -19,51 +24,46 @@ SerialReceiver *serialReceiver;
void setup()
{
Serial.begin(9600);
scheduler.init(100); // NOTE: Might be set higher to use less power, needs testing.
scheduler.init(50); // NOTE: Might be set higher to use less power, needs testing.

/**CREATE TASKS**/
// ServoTestTask *servoTask = new ServoTestTask();
BlinkTask *blinkTask = new BlinkTask(L2_PIN);
// TODO: BlinkTask *blinkTaskForCheckOutTransit = new BlinkTask(L2_PIN);
BlinkTask *blinkTaskTransit = new BlinkTask(L2_PIN);
BlinkTask *blinkTaskWashing = new BlinkTask(L2_PIN);
// CountDown *countDownTask = new CountDown(N3);
TemperatureTask *temperatureTask = new TemperatureTask();
// SleepingTask *sleepingTask = new SleepingTask();
// WaitingTask *waitingTask = new WaitingTask();
CheckInTask *checkInTask = new CheckInTask();
TransitTask *transitTask = new TransitTask(blinkTask);
TransitTask *transitTask = new TransitTask(blinkTaskTransit);
WaitForClickTask *waitForClickTask = new WaitForClickTask();
// WashingTask *washingTask = new WashingTask(blinkTask, new CountDown(N3));
// TODO: CheckOutTask *checkOutTask = new CheckOutTask(blinkTaskForCheckOutTransit);
// CountDown *countDown = new CountDown(N3); // NOTE: This is just a test.
// countDown->setActive(true); // NOTE: This is just a test.

/// serialReceiver = new SerialReceiver(); //test test test test receiver


// WashingTask *washingTask = new WashingTask(blinkTaskTransit, nullptr, temperatureTask);
// CheckOutTask *checkOutTask = new CheckOutTask();
// ExitTransitTask *exitTransitTask = new ExitTransitTask();

/**DEPENDENCIES**/
// checkInTask->addDependency(waitingTask);
// checkInTask->addDependency(sleepingTask);
transitTask->addDependency(checkInTask);
waitForClickTask->addDependency(transitTask);
// washingTask->addDependency(transitTask);
//washingTask->addDependency(waitForClickTask);
// checkOutTask->addDependency(washingTask);
// exitTransitTask->addDependency(checkOutTask);

/**ADD TASKS TO THE SCHEDULER**/
// scheduler.addTask(servoTask);
// scheduler.addTask(countDown); // NOTE: This is just a test.
// scheduler.addTask(waitingTask);
// scheduler.addTask(sleepingTask);
scheduler.addTask(checkInTask);
//Serial.println("err:errore");
scheduler.addTask(transitTask);
scheduler.addTask(blinkTask);
scheduler.addTask(blinkTaskTransit);
scheduler.addTask(blinkTaskWashing);
// scheduler.addTask(countDownTask);
scheduler.addTask(temperatureTask);
scheduler.addTask(waitForClickTask);

// scheduler.addTask(washingTask);

// TODO: scheduler.addTask(checkOutTask);
// TODO: scheduler.addTask(blinkTaskForCheckOutTransit);
// scheduler.addTask(checkOutTask);
// scheduler.addTask(exitTransitTask);
}

void loop()
{
// serialReceiver->readData(); //@EMANUELE this is a test to try the serialReceiver, it must go instantiate when the arduino is in error state
//read the class briefs
// read the class briefs
scheduler.schedule();
}

0 comments on commit 2f8bb18

Please sign in to comment.