led_test.ino 444 B

1234567891011121314151617181920212223242526
  1. #include <Automaton.h>
  2. // This example demonstrates running state machines logging their state changes to the serial port
  3. int ledPin = LED_BUILTIN;
  4. int buttonPin = 2;
  5. Atm_led led;
  6. Atm_button button;
  7. void setup() {
  8. Serial.begin( 9600 );
  9. led.trace( Serial );
  10. button.trace( Serial );
  11. led.begin( ledPin )
  12. .blink( 1000 );
  13. button.begin( buttonPin )
  14. .onPress( led, led.EVT_TOGGLE );
  15. }
  16. void loop() {
  17. automaton.run();
  18. }