- Full tutorial: STM32 Micropython
- Download the latest MicroPython firmware for STM32F4-Discovery
- STM32F4-Discovery pins definition for MicroPython
import pyb
# Define the pins to be used
greenLed = pyb.Pin('LED_GREEN', pyb.Pin.OUT_PP)
redLed = pyb.Pin('LED_RED', pyb.Pin.OUT_PP)
blueLed = pyb.Pin('LED_BLUE', pyb.Pin.OUT_PP)
orangeLed = pyb.Pin('LED_ORANGE', pyb.Pin.OUT_PP)
while true:
# Turn on Green LED
greenLed.value(1)
pyb.delay(1000)
# Turn off Green LED
greenLed.value(0)
pyb.delay(1000)