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();
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.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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#PuckBasically you can just do:
Puck.mag()
to get the magnetometer readings, or can set it up to run in the background: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.htmlBut 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.