Page 1 of 1

Initialising GPIO’s in the Hal file or boot.Pty file?

Posted: Sat Oct 24, 2020 1:33 pm
by HarryOz
Are there any examples of how to set pins as outputs and then configure them to low or high.

I would certain pins on the STM32 to be set as outputs and set low on startup.

Any help is appreciated.
Harry


Sent from my iPhone using Tapatalk

Re: Initialising GPIO’s in the Hal file or boot.Pty file?

Posted: Sat Oct 24, 2020 2:58 pm
by dhylands
When your board resets all of the pins are configured as inputs.

You can configure them as outputs using the first example here: http://docs.micropython.org/en/latest/p ... s-and-gpio

If you need to control the value of your pin before your code gets control then you’ll need to use something like an external pull-up or pull-down resistor.