You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Yeah, sorry - this isn't documented well at the moment. The Puck specific things are already built in, in the Puck object. Info here: http://www.espruino.com/Reference#Puck

    Basically you can just do: Puck.mag() to get the magnetometer readings, or can set it up to run in the background:

    Puck.magOn();
    Puck.on('mag', function(xyz) {
      console.log(xyz);
    });
    // Turn events off with Puck.magOff();
    

    IR transmitter works with Puck.IR() as well - example of doing it from a website here: https://github.com/espruino/espruino.github.io/blob/master/puck3.html

    But I'll do a tutorial on using it (and getting the IR signals to use) soon.

    The I2C crashing it is a strange one - it could be it was just waiting for a response. It might be next time you can just break out with Ctrl+C, but I'll look into it.

About

Avatar for Gordon @Gordon started