lastTime is the time in seconds at which the pin last changed state. When using edge:'rising' or edge:'falling', this is not the same as when the function was last called.
Yes, but it's easy enough to work around?
var lastTime;
var RPM;
var w=setWatch(function(e) {
RPM = 60 / (e.time - lastTime);
lastTime = e.time;
counter++;
},
pin,
{repeat: 'true', edge:'rising'}
);
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.
Yes, but it's easy enough to work around?