Puck.js v2 only You can use the puckjsv2-mag-level (About Modules) module to configure the Puck.js magnetometer for ultra low power mode (40uA) while acting like a reed switch (detecting when field strength is high or low). This will not currently work on Puck.js v2.1
I tried it with my 2.1 puck.js and it indeed does not work:
Uncaught Error: Puck.js v2 required for this module
at line 1 col 78
...2 required for this module");var e;exports.on=function(c){c=...
Uncaught TypeError: First argument to EventEmitter.on(..) must be a string
at line 2 col 34
require("puckjsv2-mag-level").on();
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.
Is it possible to somehow use a puck.js v2.1 as a reed switch?
Documenation says that it is not possible with version 2.1: https://www.espruino.com/Puck.js#magnetometer
I tried it with my 2.1 puck.js and it indeed does not work:
Any way to get this working?