Writing code
Writing code for LCD display
Got a chance to write some C# code. I had to learn how to code the Netduino, I've not worked with it before. Luckily it is a very smooth transition for a .NET developer to migrate into the hardware world!
Wrote classes to deal with scanning the optical readers. The first class runs in a thread and is hooked up to the optical sensor at the rear of the slot. When it detects a card in front of it, an event is raised back to the main thread. I had to develop a locking mechanism to prevent too many events being raised, so it will not raise any more events until the card has been removed again.
Wrote a class to read the array of 8 sensors calling a read() method, returning the value that they represent as an event back to the main thread.
Wrote a display set of classes. This runs in its own thread. Normally it cycles around giving instructions to the users and "advertising" the project with scrolling messages etc. However it also has a message queue, so the main thread can queue up message sequences to run in response to events. These messages are of defined time intervals, but are optionally interuptable should another message need to be shown. An example is the "Reading card..." message that shows until it is interrupted by another message.
I also wrote a class to do with persisting settings to SD card. The Netduino has an SD card capability. So i write the current secret number any any guesses made thus far to the SD card so that if the project is power cycled, it will come back on in the sate it was left with the same secret number.
The main thread also go written, which has the general workflow control, responding to events and kicking of processes as required.
All written on a long evening in a hotel in London and another evening at home.