https://gist.github.com/fnishio/b2063941b82f2cf1b935n
の''.join(["0x%02X " % x for x in Bytes]).strip()
はどういう意味ですか。
import spidev import time spi = spidev.SpiDev() spi.open(0, 0) def BytesToHex(Bytes): return ''.join(["0x%02X " % x for x in Bytes]).strip() try: while True: resp = spi.xfer2([0x01, 0x02]) print BytesToHex(resp) time.sleep(1) except KeyboardInterrupt: spi.close()
具体的にどの部分の何が分からないのかを記載ください。(join, strip, "0x%02X "の部分など)
