It means that it'll call the function more than once if the pin changes state more than once (after it's been debounced). repeat:false will only ever call the callback function once.
I'm driving a relay via a FET with protection diode from Pico
I'd have to see the circuit... to me it sounds like something is wrong with the way the Pico is wired up, so that it is unable to pull the pin's voltage down to 0v (it can supply 20mA on a pin, but that's it).
To me, 2.43v looks close-ish to 3.3v - 0.7v - so the voltage rail minus the diode voltage drop. Are you sure you didn't just put the diode in backwards?
Also you shouldn't need to use pinMode at all - if you don't specify it, digitalWrite/digitalRead/etc will automatically change the pin state for you.
Maybe try doing digitalWrite(pin,0); on a pin that isn't connected to anything and see what happens - it should go down to near enough 0v.
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.
Hi,
It means that it'll call the function more than once if the pin changes state more than once (after it's been debounced).
repeat:false
will only ever call the callback function once.I'd have to see the circuit... to me it sounds like something is wrong with the way the Pico is wired up, so that it is unable to pull the pin's voltage down to 0v (it can supply 20mA on a pin, but that's it).
To me, 2.43v looks close-ish to
3.3v - 0.7v
- so the voltage rail minus the diode voltage drop. Are you sure you didn't just put the diode in backwards?Also you shouldn't need to use
pinMode
at all - if you don't specify it,digitalWrite
/digitalRead
/etc will automatically change the pin state for you.Maybe try doing
digitalWrite(pin,0);
on a pin that isn't connected to anything and see what happens - it should go down to near enough 0v.