Raspberry Pi - SPI Communication
What will the following code print if the MCP3008 channel 0 reads maximum voltage?
import spidev
spi = spidev.SpiDev()
spi.open(0,0)
resp = spi.xfer2([1, (8+0)<<4, 0])
data = ((resp[1]&3) << 8) + resp[2]
print(data)
15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions