vindhyachal
Posts: 49
Joined: Mon Jun 22, 2015 6:35 pm

Understanding SPI library ; RPI2

Tue Jul 07, 2015 1:50 pm

1. I am using RPi2 with raspbian loaded. I am using SPI library from here:
http://www.raspberrypi-spy.co.uk/2013/1 ... n-mcp3008/

Also .c file I have attached.

2. Problem is I don't understand how to call functions here.
e.g This is how tx/rx function is defined:

static PyObject *SpiDev_xfer2(SpiDevObject *self, PyObject *args)

It has two struct arguments. But when function is called, it is called as:

adc = spi.xfer2([1,2,3])

where argument contains list of values you want to tx & it reurns valye rx.

Return to “Beginners”