Most sensors tend to communicate with other devices based on one of three well-defined mechanisms: I2C, SPI or good old analog output. There are dozens of other serial buses and communication protocols out there (CAN, 1-Wire, etc.), and they all have their strengths and weaknesses, but I2C, SPI and analog cover the overwhelming majority of sensors you're likely to hook up to your development board.
I2C is a particularly useful bus with the for two main reasons:
- It only requires two shared lines: SCL for the clock signal, and SDA for the bi-direction data transfers.
- Each I2C device uses a unique 7-bit address, meaning you can have more than 120 unique I2C devices sharing the bus, and you can freely communicate with them one at a time on an as-needed basis.
A Note on Distributions
Please note for the Raspberry Pi that this tutorial is based on Occidentalis, Adafruit's own educational Linux distro for Pi. It should work just as well with the latest Wheezy distro, etc., but it hasn't yet been tested on anything else.For the Beaglebone Black this tutorial is based on the Debian distribution that's shipping with recent Beaglebone Black boards. If you're using an older Beaglebone Black with the Angstrom distribution it's highly recommended that you grab a micro SD card and load it with Debian!
Text editor powered by tinymce.