kinda OT: latest fun with Arduino, UI with a single knob/button and screen.

Michael Torrie torriem at gmail.com
Sun Feb 3 00:31:08 MST 2013


Just wanted to show off some Arduino stuff.  Not that I need the
validation; I just think it's really fun and cool.  As fun as Linux!
Most of my coding on this latest project has gone into making a sort of
event-driven UI system for the Arduino that uses only a rotary encoder
dial/pushbutton combo for user input, and a 2-line LCD display.  I'm
well on my way to being the next Steve Jobs with minimal, yet intuitive
input methods (or not).

I'm please how it worked out.  It's all written with some simple C++
classes and a bunch little tiny state machines that process the events
from the main loop.  The end result is a UI that kind of behaves
linearly while preserving the ability to still do things like
calculations, read signals, etc.  My flow meter is read with an
interrupt but the encoder and button are polled.  Eventually I'll have a
unified interrupt routine to read interrupts from the encoder, the flow
meter, and the softwareserial connection (for communicating with another
arduino).  I pretty much implemented everything myself (partly for the
experience, partly because I didn't like the existing code people have
written), so it's not quite yet super optimized, but it all works, and
the logic to read the encoder (a gray code decoder routine) deals nicely
with bounces and stays pretty darn accurate, indent to indent as you
turn it.

http://www.youtube.com/watch?v=0bl46cXBgNc

Definitely not linux, but it's just as fun!  And doesn't require very
much electrical knowledge even!


More information about the PLUG mailing list