SPI Communication - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: SPI Communication (/thread-3007.html) |
SPI Communication - Raudert - Apr-24-2017 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-on-raspberry-pi DAC Source: https://widgetlords.com/products/pi-spi-2a0-raspberry-pi-analog-output-ma-vdc-interface |