0

SPI-Python: Hardware SPI for RasPi from Python #piday #raspberrypi @Raspberry_Pi

SPI-Python

Here’s a tutorial how to AVOID bit-banging and use the hardware via C (while still in Python), shared by Louis Thiery in the Adafruit Forums. And here is the code in Github.

This implementation of SPI in Python is hardware based. Linux-level C code is compiled as a Python module. I first learned how to get SPI working on the Raspberry Pi with help from a tutorial by Brian Hensley. However, I love Python and I wanted to use this hardware implementation of SPI from within Python. I little searching told me that what I wanted to do was to “extend” Python with C and so this reference was very helpful.

Read more.


998Each Friday is PiDay here at Adafruit, be sure to check out our posts, tutorials and new Raspberry Pi related products. Have you tried the new “Adafruit Raspberry Pi Educational Linux Distro” ? It’s our tweaked distribution for teaching electronics using the Raspberry Pi. But wait, there’s more! Try our new Raspberry Pi WebIDE! The easiest way to learn programming on a Raspberry Pi.

Want a FREE RASPBERRY PI? All orders over $350 get a FREE Raspberry Pi Model B with 512MB RAM!


Join 6,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

CircuitPython in 2018 – Python on Microcontrollers is here!

Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Follow Adafruit on Instagram for top secret new products, behinds the scenes and more https://www.instagram.com/adafruit/


Maker Business — @the_prepared is Soliciting Original Content on Diversity, Equity, and Inclusion

Wearables — Victorian Arduino pizzazz

Electronics — Counting Pin Numbers

Biohacking — Exploring Our Inner Reality : Entopic Visions

Python for Microcontrollers — Building robots with Python, CRICKITS of the week, upcoming hackchat’ & more…

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !



3 Comments

  1. A little confused, how is this different from the SPI support that is already in occidentalis?

  2. There is a Python module for SPI called py-spidev. https://github.com/doceme/py-spidev

    I found it a few weeks ago when I was writing the Gertboard test suite in Python. IIRC it was Jeremy Blythe’s blog where I first heard about it. 🙂

    Not much documentation though, but I managed to get it working.

  3. Oh – this tutorial is supposed to explain how to NOT bit-bang SPI in Python…

    I didn’t know about the py-spidev before I wrote my library. It pretty much lines up exactly with what I did 😛

Sorry, the comment form is closed at this time.