You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Hi,

    What does repeat: true do?

    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.

About

Avatar for Gordon @Gordon started