Mods to make the code work with codebender and also to allow examples to compile using arduino-make