Raspberry Pi Examples |
These examples are designed to demonstrate how to use a range of our modules on a Raspberry PI. You will need an SD card with the latest official Raspbian Linux distribution running on it.
I2C Modules
The Raspberry PI I2C port is not enabled by default there is a rpi_i2c_setup.doc
documenting the process I used to get i2c running on the Raspberry PI. We have provided the source code for download ready to be compiled and used on
your system. There is also a diagram below showing which pins on the Raspberry
pi's GPIO header to use for the i2c port.
MD49
The RPi serial port is used to
communicate with the MD49 and drive the motors. Before this can be done you must
change some settings to allow you to access the serial port in your own
software. There is a rpi_serial_setup.doc
explaining how this is done. As the serial port is not 5v tolerant you need some
resistors to set the output signal from the MD49 to the appropriate 3.3v level,
there is a diagram showing this below.
SRF01
Follow the instructions above to get the serial port going on your RPi. The
SRF01 uses a single I/O pin for serial I/O so you will need a diode as shown below
USB-RLY08b
This example shows how to read and write from the USB port.
RPi I2C Examples | |
CMPS03 | Read bearing data from the CMPS03 |
CMPS11 | Read bearing, pitch and roll data from the CMPS11. |
CMPS12 | Read bearing, pitch and roll data from the CMPS12. |
SRF02 SRF10 SRF235 |
Read range data from an SRF02, this example will also work for the SRF10 and SRF235. |
SRF08 | Read range and light data from an SRF08. |
TPA81 | Read ambient temperature and 8 pixel temperature readings from the TPA81 |
MD03 | Drive the motor connected to an MD03 |
MD22 | Drive both motors connected to an MD22 |
MD25 | Drive the EMG30 motors to a specific encoder count |
LCD05 | Display text on an LCD05 |
LCD05-162 | Display text on an LCD05-162 |
SD21 | Move servo 1 on an SD21 |
RLY08 | Change the relay states of an RLY08 depending on what they already are. |
RPi Serial Examples | |
SRF01 | Read software version and range in CM from an SRF01 |
MD49 | Use the serial port to drive the MD49 motors and display the encoder values |
RPi USB Example | |
USBRLY08b | Change the relay states of a USBRLY08b connected to the USB port |
The diagram below shows how to connect the I2C-LVL01 to the RPi for use with 5v I2C modules.
Raspberry pi i2c port diagram for use with 3.3v I2C modules.