Automaton: multitasking state machine framework

I just finished a state machine framework for Arduino.

  • It provides a framework that makes your sketches event based
  • Unlike the other Arduino state machine libraries it uses a table driven state machine concept in which every machine is an self contained object
  • It allows you to define state machines that can be shared as stand alone Arduino libraries (dependent only upon Automaton)
  • It comes with a collection of predefined reusable state machines for handling buttons, blinking and fading leds, detecting pulses, monitoring analog inputs, timers and receiving commands over serial communications.
  • State machines can communicate with each other via messaging queues.

It can be installed from the Arduino IDE’s library manager or downloaded from https://github.com/tinkerspy/Automaton

Extensive documentation and a tutorial are available here:

I think it provides a new way of using state machines on Arduino that makes it easy to build multi tasking applications with simple building blocks. It certainly helped me to write clearer and more stable applications.

Please have a look and tell me what you think.

(I’m not a novice programmer, but this is my first attempt at an Arduino library)

Please have a look and tell me what you think.

I think it would have been better if you had used the link icon (two to the right of the multicolor one on the top row) to actually post links.

Thanks Paul,

Fixed it.

Responding to originating post ( Tinkerspy ): GOOD JOB !!

That was very clever of you to HAVE the "millis" ( name) in the timer code to ward off the "Arduino Gate Keepers", you know they wouldn't like you not using the 'BWOD' gospel ( millis() then compensate for the Rollovers). I noticed you set it high then decremented - good ! BTW, I also have written a few lines of code ( in my day), and am recently a "heretic" from the locked/closed "Multitasking" forum. They "caught" me NOT using millis() in my example.

Happy New Year Tinkerspy !

Tinkerspy: I just finished a state machine framework for Arduino.

  • It provides a framework that makes your sketches event based
  • Unlike the other Arduino state machine libraries it uses a table driven state machine concept in which every machine is an self contained object
  • It allows you to define state machines that can be shared as stand alone Arduino libraries (dependent only upon Automaton)
  • It comes with a collection of predefined reusable state machines for handling buttons, blinking and fading leds, detecting pulses, monitoring analog inputs, timers and receiving commands over serial communications.
  • State machines can communicate with each other via messaging queues.

I think you created exactly what I was searching for my Autonomous Rover project, which I am setting up to run with a FreeRTOS for Arduino framework. https://polarsys.org/wiki/ISO/IEC_29110_Lifecycle_Demonstration_Case_Study

rhoude57: I think you created exactly what I was searching for my Autonomous Rover project, which I am setting up to run with a FreeRTOS for Arduino framework. https://polarsys.org/wiki/ISO/IEC_29110_Lifecycle_Demonstration_Case_Study

That looks very cool indeed. An old friend of mine is working on the Mars Rover at NASA. Perhaps I should suggest he do the same ;-)

Would you be running Automaton inside FreeRTOS or as an alternative to it?

I'd be interested to hear how that's working out for you.

TechnoBubba: Responding to originating post ( Tinkerspy ): GOOD JOB !!

That was very clever of you to HAVE the "millis" ( name) in the timer code to ward off the "Arduino Gate Keepers", you know they wouldn't like you not using the 'BWOD' gospel ( millis() then compensate for the Rollovers). I noticed you set it high then decremented - good ! BTW, I also have written a few lines of code ( in my day), and am recently a "heretic" from the locked/closed "Multitasking" forum. They "caught" me NOT using millis() in my example.

Thanks! I somewhat accidentally did the right thing with the millis math to support single rollovers. I recently updated the 'Atm_timer' state machine to support setting timers of up to 136 years. Let's see those Atmel guys create a microcontroller that can last that long!

Or a power supply even... :o

Make sure you have good power supply back up (battery, or supercap) to get thru power outages.

CrossRoads:
Make sure you have good power supply back up (battery, or supercap) to get thru power outages.

I was thinking of getting a plutonium 238 based RTG with a 87 year half life but I can’t seem to find any on ebay.