def get_spi(self):
spi = None
try:
spi = spidev.SpiDev()
bus = 0
device = 0
spi.open(bus, device)
spi.max_speed_hz = 10000000
spi.mode = 0b00
spi.lsbfirst = False
except Exception as e:
print(e)
GPIO.cleanup()
if spi:
spi.close()
spi = None
return spi
# https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/README.md
# https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=19489
controller_rpi.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录