-
• #2
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: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.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.
-
• #3
Just to add, I've put some more detailed info on the Puck page now: http://www.espruino.com/Puck.js
-
• #4
Spectacular! That's just the info I needed.
Thanks Gordon.
-Ken
Anyone have a working example of using the MAX3110 Magnetometer or the IR Transmitter?
I didn't see an IR example.
When I looked at the Espruino modules, I saw one for the MAX3110 from sparkfun..Yay! Paste the code in from the last example in the web page.
The puck said:
Basically, I just had to open it up, push out the battery, and start again.
Any thoughts anyone?
-Ken