Code: Select all
#define MICROPY_HW_SPI2_NSS (pin_B9)
#define MICROPY_HW_SPI2_SCK (pin_B13)
#define MICROPY_HW_SPI2_MISO (pin_B14)
#define MICROPY_HW_SPI2_MOSI (pin_B15)
Code: Select all
import machine
import pyb
pinB9 = machine.Pin(machine.Pin.cpu.B9, machine.Pin.OUT_PP, machine.Pin.PULL_NONE)
pinB10 = machine.Pin(machine.Pin.cpu.B10, machine.Pin.OUT_PP, machine.Pin.PULL_NONE)
pinB13 = machine.Pin(machine.Pin.cpu.B13, machine.Pin.OUT_PP, machine.Pin.PULL_NONE)
pinB14 = machine.Pin(machine.Pin.cpu.B14, machine.Pin.OUT_PP, machine.Pin.PULL_NONE)
pinB15 = machine.Pin(machine.Pin.cpu.B15, machine.Pin.OUT_PP, machine.Pin.PULL_NONE)
count = 0
while ( count < 40):
pinB9.value(0)
pyb.delay(100)
pinB9.value(1)
pyb.delay(100)
count = count + 1