The Automaton framework allows you to create Arduino applications that consist entirely of concurrently running components (finite state machines) interacting with one another. Changes are automatically propagated through the application like changes in a spreadsheet.
Automaton components can trigger each other and form intricate control structures. Automaton helps you create your own components, makes them interact with the bundled components to let you control whatever your Arduino or its peripherals are capable of doing.
Comes with bundled state machines for timers, leds, analog inputs, comparators, logical operations, buttons, rotary encoders and a music/pattern sequencer.
Extensive documentation, tutorials and code available at:
https://github.com/tinkerspy/Automaton/wiki
This simple example demonstrates the use of a led component with a button component to toggle a blinking led when the button is pressed.
#include <Automaton.h> // Toggle a blinking led (pin 5) with a button (pin 2) Atm_led led; Atm_button button; void setup() { led.begin( 5 ) .blink( 200, 200 ); // Set up a led to blink 200ms/200ms button.begin( 2 ) .onPress( led, led.EVT_TOGGLE_BLINK ); / Toggle the led when button pressed } void loop() { automaton.run(); }
Get the Automaton via the Arduino library manager, platformio or the installation page: https://github.com/tinkerspy/Automaton/wiki/Installation
More: https://github.com/tinkerspy/Automaton/wiki/Contributed
Documentation for the (Automaton & Machine) base classes and the bundled components is available in the Github wiki: https://github.com/tinkerspy/Automaton/wiki
If you want to make your own components, which is where the real fun is, look at the machine building tutorial:
tinkerspy@myown.mailcan.com