#include "Automation.h"
#include "Atm_led.hpp"
#include "atm_button.hpp"
#define DEBUG 0 // This toggles the debug() statements 1 for on, or 0 for off.
#if DEBUG == 1
#define debug(x) Serial.print(x); // Use debug(x) to toggle Serial.print
#define debugln(x) Serial.println(x);
#else // Else the the compiler does not generate Serial.print statements
#define debug(x)
#define debugln(x)
#endif
// Toggle a blinking led with a button
int ledPin = 5;
int buttonPin = 2;
Atm_led led;
Atm_button button;
void setup() {
int i = 2;
Serial.begin(115200);
led.begin( ledPin )
.blink( 200, 200 ); // Set up a led to blink 200ms/200ms
button.begin( buttonPin )
.onPress( led, led.EVT_TOGGLE_BLINK ); // Toggle the led when button pressed
Serial.print(F("Setup ready:"));
}
void loop() {
debugln("running");
automaton.run();
}