gobot icon indicating copy to clipboard operation
gobot copied to clipboard

How to set pin is pulled high or pulled low or not pulled?

Open hacktronics opened this issue 3 years ago • 3 comments
trafficstars

How to set pin is pulled high or pulled low or not pulled? The question is specific to Raspberry Pi, but in general I couldn't find in the button driver, how to set the pin is pulled or not. In one support question, I found how to change the default push state, but does gobot support pull characteristics of a pin?

hacktronics avatar Sep 12 '22 06:09 hacktronics

Please could you specify which driver you use. Maybe I could help, although I have no Raspi but Tinkerboard, most parts are implemented identically.

gen2thomas avatar Sep 12 '22 17:09 gen2thomas

I mean for buttons, how do you set the pulled mode in the Raspberry Pi. https://gobot.io/documentation/examples/raspi_button/ I found how to change the default push state, but does gobot support pull characteristics of a pin?

hacktronics avatar Sep 20 '22 04:09 hacktronics

Possibly you mean a pullup or pulldown resistor to prevent floating input, e.g. for button or an open collector (e.g. when using opto couplers). Not all devices have internal resistors and some, which have them, are not all supported by gobot. So the best way is to apply an external resistor.

In case you have an pulldown resistor and an button to positive voltage, this will just cause inverse logic.

Please also have in mind that some debouncing logic should be added in case you will count something or pulses are not allowed for your actuator. Maybe this is good enough filtered by the 10ms poll interval, but this depends on your special hardware.

gen2thomas avatar Sep 20 '22 11:09 gen2thomas

the internal pull up/down feature will be implemented with #897

gen2thomas avatar Jan 23 '23 18:01 gen2thomas

part of release v2.0.0

gen2thomas avatar May 15 '23 16:05 gen2thomas