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.
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)
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.
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.
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. Eclipse PolarSys | projects.eclipse.org
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!