Accessing both SPI ports on the raspberry pi using python

Turns out it’s not that hard at all! Here’s a video of the whole thing working:

This basically works around concepts I first explained here. It’s still really cool though! SPI is really fast and really easy to use, perfect for a novice like me.

Here are the physical representations and schematics of the setup seen on my desk:

Images generated by fritzing.

Here’s the code that makes it all work!

Here is some further reading:

http://www.megaleecher.net/sites/default/files/images/raspberry-pi-rev2-gpio-pinout.jpg

http://hertaville.com/2013/07/24/interfacing-an-spi-adc-mcp3008-chip-to-the-raspberry-pi-using-c/

http://tightdev.net/SpiDev_Doc.pdf

Thanks for reading!

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.