May 29, 2014

Experimenting with Arduino state machine programming

Although most of us are happy to create Arduino sketches using procedural methods from C++ and other experiences, there are other methods and one of these is by using state machine programming. The operation of a state machine can usually be described by:

... having an initial state or record of something stored someplace, a set of possible input events, a set of new states that may result from the input, and a set of possible actions or output events that result from a new state

And this method has been demonstrated well by Tony Keith who demonstrates how to write an Arduino sketch to work with an LCD and numeric keypad in the state machine method. He explains the logic and coding behind the method, and after a few moments it is quite clear. 

So if state machines are new to you, or you enjoy learning about different ways of doing things - check out Tony's blog. And for more, we're on facebooktwitter and Google+, so follow us for news and product updates as well.

If you're looking to learn how to use numeric keypads and much more with Arduino, you can't go past "Arduino Workshop -  A Hands-On Introduction with 65 Projects” by John Boxall.

Arduino Workshop takes the reader from having zero knowledge about the Arduino platform, electronics and programming and leaves them with the know-how and instructions on everything from blinking an LED, to robotics, wireless data, cellular communications, motor control, sensors, Internet connected systems and more. For more information including a sample chapter and table of contents, visit the book page

Leave a comment

Comments have to be approved before showing up.