-
@oesterle, this is awesome! Happy folks are getting inspired by my "first ever code for hardware", and will certainly include the changes (after I am back from my holiday) in my gist, crediting you. The beauty of collaborative code: we all get a slice of a really good Pi(e)! :)
@Gordon those suggestions are worth billions! I wish both you and @oesterle could share the resources you used for finding some of the information you mentioned or implemented. I find the docs very "all over the place" and uninviting or maybe I am used to more verbose docs like jQuery, Angular, Ionic or Node's documentation. That bit about the magnetic field changing, that's interesting. I was somewhat worried that might actually happen at some point, but since it never did so far, I assumed I was seeing trouble where there wasn't any.
I will have to try the
falling
bit out, it would save me the need to rely on the magnetometer altogether which while a cool effect, is a less desirable solution.The IDE issue I faced both online and the GitHub version (I have it installed locally as well). In hindsight it may have not been what prevented my puck working - as eventually I did restart the machine at some point, but not knowing how the IDE code works and what's needed for things to run, that syntax error was staring me too much in the face. Probably a coincidence that after it got fixed my IDE started working too. On that note however, connecting to the Puck is still a hit and miss, and if I want to be certain it starts and connects to the IDE, I need to restart my Mac. Removing and adding it again, does not help. I believe this has been documented before.
-
You can find the code on my gitHub.
You can also read about my reason for building this in the Medium article I posted.
-
Writer of codes, blogs and things that live on the web. Programming polyglot, pragmatic doer, member of the “taking care of business” crowd, with a no nonsense attitude.
An easily inspired inspirational individual with a strong predilection towards most things nerdy, good, carnivorous food and Lego.
Uses a Mac.
@Gordon, @oesterle, both of you, thanks again for your suggestions. Truly invaluable!
I've updated the article to reflect the code changes and added a second implementation that uses the short/long button press approach I initially thought was wrong.