Python Forum

Full Version: SPI Communication
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have recently purchase a Pi-SPI-2AO Digital to Analog converter for a project I am working on here. I have done quite a bit of research but I still am not sure how to send an output, my knowledge in this area is VERY limited. So please bear with me. I am using the spiDev library across channel CE-0 and I am attempting to send a 0-10V signal. Has anyone used this before or could possibly be of help.
import spidev
import time

spi = spidev.SpiDev()
spi.open(0,0)
while True:
    resp = spi.xfer2([0x00])
    print resp[0]
    time.sleep(1)
My primary question is in the 6th line. From the source it says "0x00" is sending an array of bytes. What does this mean?
Source Material: http://www.100randomtasks.com/simple-spi...spberry-pi
DAC Source: https://widgetlords.com/products/pi-spi-...-interface