Tuesday, January 29, 2013

Kickstarter success: Digispark received!

What an exciting day!  I got my Digispark Arduino board the other day.  I kicked in on Kickstarter for the reward level with two boards plus a few accessories.  Everything is just as described in the pitch and I couldn't be happier.  This is a tiny board at an equally tiny price.


It was $21 for two devices, and should be $8/chip in quantity in production.  I can use the Arduino IDE, and power it directly from USB (or AC/DC USB charger adapter).  It has six inputs/outputs, onboard LED, and supports emulation for mouse/keyboard/joystick with almost no effort.  It's really an amazing little device and if you like hardware hacking, you need to get yourself one now.

So far I've done some simple keyboard prank stuff, the blinking light ("hello world" of Arduino I think), and done a pulsing buzzer.  I have a cheap Bluetooth module and I plan on creating a simple interface from our treadmill to computer/phone.  It's cheap enough to do that kind of thing!

Did you get one?  What do you think?

Problems with serialization and ApplicationSettings

DataContract makes it so easy to serialize your data classes!  Unfortunately, if there are any errors, you may not see them -- especially if you are saving/loading the data using ApplicationSettings.  First, change exception settings to see all thrown (not just uncaught).


Now you will see that any fields with "private set" are not serializable.  Such a simple fix, but without showing "thrown" exceptions, you just have to guess!



So now you know!  If you plan to serialize a field, don't make it private set.  If you required a privately settable field, then you can perform advanced work to enable the scenario, but that's on you!

Friday, January 11, 2013

Windows Phone Location Simulator

Wow.  I feel stupid!  I've never had consistent luck with the location simulator for my WP apps, and I always just assumed it was buggy.  Sometimes I would get PositionChanged events, and other times I wouldn't.  It turns out, that there's a perfectly reasonable explanation!  If you have your accuracy set to Default, it will ignore the simulator.  Of course, at run-time, you want Default for best battery savings (if you don't need high accuracy.  The simple answer is to change it based on debugging!  I'm glad I chanced to look it up instead of just being frustrated this time.

Source: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202933(v=vs.105).aspx