The arduino nano portion of the project
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
#include <ArduinoJson.h>
#define RELAY_ON 0
#define RELAY_OFF 1
#define BALLAST_SIZE 3
struct ballast { int id; int shour; int smin; uint32_t fadePeriod; int ehour; int emin; int stage; int brightness; int pin; unsigned long fadeStartMillis; int relayPin; };
void setupBallast(ballast *b); int setupBallasts(ballast *b_arr[], size_t arr_size, JsonObject &root); void doBallast(ballast *b, int hr, int mn); void updateBallast(ballast *b, JsonObject &root); void manualMode(ballast *b); int getFreeRam(); const size_t bufferSize = JSON_ARRAY_SIZE(3) + JSON_OBJECT_SIZE(2) + 3 * JSON_OBJECT_SIZE(5) + 180;
const unsigned long loopPeriod = 1000;
const unsigned long data_send_period = 2000;
|