Happy New Year

First day of a new year. Time to get back on the horse.

I've gone to the dark side in more ways than one. I'm writing this post on my new MacBook Air, my first Mac. My intention with it is to get into iOS development for iPhone and iPad. But more importantly I've moved my "Arduino" development to a new platform at present. I'm developing on a .NET Micro Framework device. It's a FEZ Panda II from GHI Electronics.

Why the change? I've been working on a few different projects all of which involve at least two serial devices, usually a GPS receiver and an OLED screen. After developing my own software serial class and generally finding life difficult with an Arduino Duemilanove, I bought a Mega. Having more than one UART available made life a whole lot easier.
But then I found what I really wanted was multithreading. Had I been a real code ninja I would have developed my own mini operating system in C++ on the Mega. But, alas, I'm not that strong (yet!) so I chose to move platforms to the .NET world and see how that goes.

So far I've rewired my Arduino brain and successfully got basic GPS data displaying on my OLED screen. The bulk of the effort so har been around learning multithreading, locking and inter-thread communication. To overcomplicate things a bit I've also tried to implement the model-view-controller (MVC) pattern. Just this morning I've got the complete data set from the GPS receiver unpacked from NMEA sentences into "natural" objects. I'm aiming to produce a 'screen full of numbers' to just see the output of the GPS and be able to watch it as I move around, but this morning I'm stuck thinking about the validity of the information coming from the GPS.

GPS data comes in different NMEA sentences. Each sentence provides a subset of the entire information available. As each sentence is unpacked, each datum is added as a property the Location.Model object. When the first few sentences are extracted, the model is incomplete. You can know the time, but not the location (latitude and longitude). Or, if the initial sentences arrive in a different order, you may know the speed and heading, but not the date. I'm working through this initial state to ensure that the data is coherent before it is used. I suppose the simplest thing might be to set a flag once all fields have been populated. Then again, different sentences have different validity indicators. You can get a valid date, time and location before you can get satellite information. Perhaps I should fire separate events for DateTimeReceived, Location2DReceived, SpeedHeadingReceived as valid data is received for each so they can be subscribed to or ignored as necessary. Cool, I'll do that for now.

I'd like to be posting code snippets, but at this stage I feel like I should be uploading the entire Visual Studio solution. Anyway, my latest code is on a different machine at present and I haven't committed the latest version. Hmmm, source control. There's an interesting subject. I should document what I've learned there too.

That is all.