Oh perfect - I didn't look there! So yeah, wiring it up will be trivial.
You could wire to anything but let's say you chose to wire one side to GND and one to B3:
var lastRotation = getTime(); function anemRotated(e) { var d = e.time-lastRotation; lastRotation = e.time; console.log("Speed = "+(60/d)+" rpm"); } pinMode(B3, "input_pullup"); // activate pullup resistor setWatch(anemRotated, B3, {repeat:true, edge:"falling"});
You'd need to run something every few seconds that's check whether it had in fact stopped turning, but otherwise that's it...
@Gordon started
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.
Oh perfect - I didn't look there! So yeah, wiring it up will be trivial.
You could wire to anything but let's say you chose to wire one side to GND and one to B3:
You'd need to run something every few seconds that's check whether it had in fact stopped turning, but otherwise that's it...