from machine import Pin, SPI
import time
# Initialize SPI0
spi = SPI(0, baudrate=100000, polarity=0, phase=0, sck=Pin(2), mosi=Pin(3), miso=Pin(4))
cs = Pin(5, Pin.OUT, value=1) # Active LOW
while True:
message = b'\x01\x02\x03'
# Assert CS pin (low) to start communication
cs.value(0)
# Write data to the Target
spi.write(message)
# De-assert CS pin
cs.value(1)
print("Sent:", message)
time.sleep(1)Loading
pi-pico-w
pi-pico-w
SPI CS (5)
SPI MISO (4)
SPI MOSI (3)
SPI SCK (2)
SPI GROUND
CONNECTION TO SLAVE RPP
SPI PROTOCOL