Hi team,
I test SPI in two case : case 1 - {Jetpack 4.6 on Jetson Nano B01 Kit} , and case 2 - {Jetpack 5.0 on Jetson Xavier NX Module}.
- I have setup SPI DONE with sudo /opt/nvidia/jetson-io/jetson-io.py
- I have install py-spidev library DONE
But have same error with my python code for SPI:
spi.open() have error2 : No such file or directory
Can you guide me how to fix it?
Thank you so much!
My python code for test SPI:
#!/usr/bin/python3
import spidev
import time
import binascii
spi = spidev.SpiDev() # Tạo đối tượng cho SPI
spi.open(0, 0) # mở port 0, device (CS) 0
spi.max_speed_hz = 500000
try:
while True:
print(“abc”)
resp = spi.xfer2([0x61,0x62,0x63,0xA]) # [‘a’,‘b’,‘c’,‘\n’]
time.sleep(1) # sleep for 1 seconds
except KeyboardInterrupt:
spi.close()