Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Missing option to add pull up or down to gpio pin #255
When using a gpio pin for input, particularly with switches, the value may sometimes be floating and may read true when there is no input even connected.
A solution is often to add a pull up or pull down resistor to the circuit and because it's so common, they are integrated into the Pi directly. The python sdk has an optional parameter to indicate if a pull up or down should be applied to the pin when it is set up. This is currently missing in the dart sdk and could greatly simplify circuits.
If you use the
(looking at the comment I can see it it was not updated after I changed an into to a enum).
It might be that the sysfs driver for the Raspberry Pi also support setting the pull up or pull down resistor.
Having looked further into this I don't think there is a way to set up the built-in pull up or pull down resistors through the sysfs interface.
If the built-in pull up or pull down resistors are used I think the best solution is to make sure they are configured before actually attaching anything to the pins.