[Microbit-Python] pullups/pulldowns on pins, in MicroPython on micro:bit

Damien George damien.p.george at gmail.com
Thu Dec 8 01:56:31 EST 2016


Hi David,

Looking at the code the default pull states seem to be:

read_analog: configured by mbed analogin_init() function, looks like
there is no pull
read_digital: PULL_DOWN
is_touched: PULL_UP

To change the value, use: pin.set_pull(pin.PULL_UP), or PULL_DOWN or NO_PULL.

Cheers,
Damien.



On 8 December 2016 at 05:06, David Whale <david at thinkingbinaries.com> wrote:
> I remember some discussions about this on github, but I can't find anything
> in the docs about default pullup/down states (and how to change the pull
> state of the pins) here:
>
> https://microbit-micropython.readthedocs.io/en/latest/pin.html
>
> Does anyone know
> (a) what are the default pull configurations for each of the pins in each of
> the following pin modes when using MicroPython (I know what the DAL sets
> them to, but MicroPython doesn't really use the DAL here I think).
>
> read_analog
> read_digital
> is_touched
>
> (b) How do you change the default pull resistor configuration for each of
> the pins?
>
> Thanks
>
> David
>
>
> _______________________________________________
> Microbit mailing list
> Microbit at python.org
> https://mail.python.org/mailman/listinfo/microbit
>


More information about the Microbit mailing list