Sorry if this is too simple,
but I cant find any information on that Pin.PULL_UP or PULL_DOWN do when I specify a pin.
The documentation said it defnies if a pull up or down resistor is... attached?
But what difference does that make in the code? Do I get a different voltage?
Pin.Pull_X
Re: Pin.Pull_X
It controls whether the internal pull-up or pull-down resistor is enabled (the docs are perhaps missing the word 'internal')
http://docs.micropython.org/en/latest/p ... b.Pin.init
http://docs.micropython.org/en/latest/p ... b.Pin.init
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Pin.Pull_X
The usual use of internal pullup or pulldown resistors is to define the state of input pins which are unconnected. This is useful when connecting switches or pushbuttons. Without a pull, when the switch is open, the state of the pin is undefined: MOS inputs are very high impedance and can float to either level.
There is another use for a pullup with a pin configured as an open drain output, but this is rather more specialised.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Pin.Pull_X
So, meanwhile i read up on pull up resistors and what floating pins are.
So the chip has internal pull up resistors that i can just turn on in code? Neat
Thanks for the explanation!
So the chip has internal pull up resistors that i can just turn on in code? Neat
Thanks for the explanation!