We have been targeting two communities in the 100 days projects, Arduino and Pmod. In today’s example we will be adding support for the wildly popular Raspberry Pi hardware. In this example we will have the Pioneer board communicate to the Raspberry Pi. The Raspberry Pi will then send values back to the Pioneer board to control a PWM connected to the LED. Also included in this example is a python script for users to create a hyperterminal program to read and write data to the Pioneer board from the Pi.
Forum Post Attachments:
At the bottom of this post we are including the following items:
- Example Project Zip File
- Project Images
The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:
The main.c firmware is included in the example project. Please review the commented sections for more details.
The firmware for this project consists of three communication protocols UART, I2C, and SPI. The Pioneer board continuously sends data over the UART and SPI lines which are received by the Raspberry Pi. The Raspberry Pi in return transmits the data back to the Pioneer board using the I2C interface. The values sent from the Raspberry Pi over the I2C port control a PWM value that drives an LED.
Also included in this example is the python script that creates the terminal window that displays the UART and SPI values on the Raspberry Pi’s OS screen. In this project we are running the Raspbian OS on the Raspberry Pi. Raspbian is a free OS based on the Debian Linux distro. The following image is for the Python code.
For this example the user will need to make a number of connections from the Pioneer board to the Raspberry Pi. On the Raspberry Pi there is a large header that will accept all of the wires from the Pioneer board. Please follow the schematics to connect the Pioneer kit to the Pi.
Test Your Project:
Program the example code into the Pioneer board, complete all of the connections to the Raspberry Pi, load up the python script and start reading in serial data.
I hope this example can help you in your design.