I'm trying to interface a Bluefruit LE SPI friend with the Feather M4 CAN. Here are my connections:
- Bluefruit SCK to Feather SCK
- Bluefruit MISO to Feather MISO
- Bluefruit MOSI to Feather MOSI
- Bluefruit CS to Feather 10
- Bluefruit IRQ to Feather 11
- Bluefruit RST to Feather 12
Code: Select all
import time
import busio
import board
import digitalio
from adafruit_bus_device.spi_device import SPIDevice
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
cs = digitalio.DigitalInOut(board.D10)
device = SPIDevice(spi, cs, baudrate=5000000, polarity=0, phase=0)
cnt = 0
while True:
cnt = cnt + 1
with device:
result = bytearray(4)
spi.readinto(result)
print(cnt, "0x"+"".join("{:02x}".format(x) for x in result))
Code: Select all
1 0x00000000
2 0x00000000
3 0x00000000
4 0x00000000
5 0x00000000
6 0x00000000