this weekend I got my reed switch from Sigma and connected it to my pico (GND and B3). As proposed, I set the pin to input_pullup and wrote a basic watch function:
Now I get some strange behaviours with different options: edge: 'rising' no debouncing
Most of the time two events when moving magnet to sensor and one when moving away.
edge: 'rising', debounce: 10
One event when moving magnet to sensor and one when moving away. The same for debounce 100 and 1000.
edge: 'falling', no debounce
Three events when moving magnet to sensor and no event when moving away.
edge: 'falling', debounce: 10
No events at all.
Not exactly what I expected. Am I right that it seems that the reed switch only closes very short but not keep closed while the magnet is next to the sensor?
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.
Hello,
this weekend I got my reed switch from Sigma and connected it to my pico (GND and B3). As proposed, I set the pin to input_pullup and wrote a basic watch function:
Now I get some strange behaviours with different options:
edge: 'rising' no debouncing
Most of the time two events when moving magnet to sensor and one when moving away.
edge: 'rising', debounce: 10
One event when moving magnet to sensor and one when moving away. The same for debounce 100 and 1000.
edge: 'falling', no debounce
Three events when moving magnet to sensor and no event when moving away.
edge: 'falling', debounce: 10
No events at all.
Not exactly what I expected. Am I right that it seems that the reed switch only closes very short but not keep closed while the magnet is next to the sensor?