Closed 32nguyen closed 5 years ago
Unicorn HAT HD doesn't use GPIO- it uses the SPI bus through the kernel SPI interface. This should, in theory, work on the jetson nano as long as it has a functional SPI bus accessible in this way. You may have to change this line to adjust the bus/chip select pin:
Failing that, you'd have to manually "bitbang" SPI and replace the calls to xfer2
with a function that clocks the data out via GPIO:
A not necessarily clear example of this is in Blinkt! which has a bitbanged _write_byte
function which is effectively what xfer2
would call for each byte passed in:
def _write_byte(byte):
for x in range(8):
GPIO.output(DAT, byte & 0b10000000)
GPIO.output(CLK, 1)
time.sleep(0.0000005)
byte <<= 1
GPIO.output(CLK, 0)
time.sleep(0.0000005)
Hi @Gadgetoid
Thanks for your detail. I will try it out.
Hi,
I am trying to use NVIDIA jetson nano to control unicorn hat hd thought Jetson.GPIO which is provided by jetson board. It is supposed to replace RPi.GPIO somewhere in unicorn library. Would please please point it out for me? Have you tested unicorn library on others device containing 40 header pins.
Thanh