Page 1 of 1

source code for read_digital, and set_pull

Posted: Thu Nov 29, 2018 12:57 pm
by rhubarbdog
i'm trying to get a sensor working.
i need to run `pinX.set_pull(pinX.PULL_UP)`
i want this to go faster so wanted to see the source to see if i can make it ,go
the problem is i cant remember the name and location of the source code for these micropython micobit objects and methods

Re: source code for read_digital, and set_pull

Posted: Thu Nov 29, 2018 1:30 pm
by Roberthh
micropython/ports/nrf/modules/machine/pin.c
nrf_gpio_cfg() is called in there to configure the GPIO pin

Re: source code for read_digital, and set_pull

Posted: Thu Nov 29, 2018 6:18 pm
by rhubarbdog
i've found much of the source. main files are /source/microbit/microbitpin.cpp and source/microbit/microbitpinmode.c. how ever microbitpin.cpp reference 2 headers "MicroBitPin.h" and "nrf_gpio.h"
i've tried the find file button on both microbit/micropython and micropython/mcropython and can't locate the or the corresponding .c files if they exist