stronk_8s

SPI Python

Nov 24th, 2025 (edited)
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | Source Code | 0 0
  1. import spidev
  2. import time
  3.  
  4. spi = spidev.SpiDev(0,0)
  5. spi.open(0,0)
  6. msg= 0xAA
  7. spi.max_speed_hz=115200
  8. while 1:
  9. spi.writebytes([0x4,0x06])
  10. y=spi.readbytes(1)
  11. print(y)
  12. time.sleep(0.5)
  13.  
Advertisement
Add Comment
Please, Sign In to add comment