• I had some ideas for improving the robustness of your code, and forked your gist.

    • Ensure BLE is turned on when Puck is powered on or battery is replaced.
    • Ensure mag turning off doesn’t happen in the middle of presenting.
    • Puck.magOn() doesn’t return a Boolean to check if on/off; added code to
      fix this.
    • Simplified character sending code to remove duplicate code.
    • Added catchy keyboard Bluetooth device name. :-)

    Feel free to incorporate the changes into your code.

  • @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.

About

Avatar for attilavago @attilavago started