I've been fascinated by open source watches for some time now (like http://www.ohwr.org/projects/f-watch/wiki) and have been wondering how hard it would be to make one ...
Sadly, this project will not be a watch but I have been playing around with an Arduino Uno and a Trinket Pro while thinking about the software and hardware needed for a watch (or I guess any portable device).
It seems to me that any sophisticated electronic device might be modelled as a state machine ... in other words the item has a fixed number of discrete states and has actions that can occur in those states. So, I started playing with the idea of coding a state machine for the Arduino (specifically, a trinket pro and an Uno because I have access to both of these).
I've got the basic state machine working with a display, buttons and a speaker with enough states implemented to test navigation between states and basic functions like turning off the backlight.
I started playing with the idea of a state machine a few weeks ago and at this point I have a functional one. Not surprisingly, The states of the machine are modelled as c++ object instances with the type of state defined by the class of the object.
I am a big fan of interpreted languages (like python) for this kind of stuff but I do not imagine you could get a lot done with a python interpreter loaded on an Arduino. I did want the flexibility of being able to define states easily and potentially dynamically. To that end the state machine loads itself from an XML definition (I used TinyXML to parse this definition).
Loading state from XML is kind-of interesting ... while testing the basic state machine I was loading the states dynamically from the serial monitor ... it raises interesting possibilities for re-programming the device remotely.
There is definitely an overhead cost to parsing the XML and maintaining a hierarchy of state objects ... it works well but this whole idea may need to be optimized or totally re-evaluated for memory consumption if the device gets very sophisticated.
So far I have a few states (for testing):
A menu state that is a holder allowing navigation through a hierarchy of states,
An LCD backlight state for toggling the display backlight
An LCD Test state that runs through the capabilities of the LCD display.
The hardware so far consists of:
Trinket
2x16 LCD display (salvaged from a previous project)
3 buttons (taken from a PS-2 mouse)
an 8 ohm speaker + resistor (taken from a cordless phone)
9 volt battery connector
I also have access to (that I can think of):
4 pin RGB led's
older bluetooth shield,
temperature sensor,
motion sensor
My goal is to use mostly scavenged parts for this project; this limits functionality and definitely means I will not be making a watch. However, I can definitely fit all of these parts and a bit more in a small-enough case for this contest ... the question is what will this device do?
The LCD I have is too big ... if I am going to make a watch I want something that ends up being 'watch sized'. Same for the RGB LED's ... I am ultimately interested in making a sports watch (like a garmin) ... Individual LED's would make for a pretty bulky sports watch.