Luca has written up a great tutorial on the differences between delay() and millis() on the Arduino, which i think is worthwhile to share. He also presents it in a very easy to understand format.
In this tutorial I am going to show you how to program an AVR(ATmega328) and an Arduino UNO using the GPIO on the Raspberry Pi.
Adding an Arduino or an AVR to your projects will give you much greater flexibility.
Hook up the Raspberry Pi to the Arduino UNO or AVR.
The image below shows how to connect a Raspberry Pi 2 and an Arduino UNO. click the image to make it larger
Here is a great project by Zheng Wang, which uses a Raspberry Pi and an Arduino to create a self driving car.
“Objective Modify a RC car to handle three tasks: self-driving on the track, stop sign and traffic light detection, and front collision avoidance.”
Source: Self Driving RC Car – Zheng Wang
Our GIT repository has been updated with an Arduino sketch which calculates angles using a complementary filter. The heading is also calculated using the magnetometer.
Detailed Guides and Tutorials
In this order;
Guide to interfacing a Gyro and Accelerometer with a Raspberry Pi
Guide to interfacing a Gyro and Accelerometer with a Raspberry Pi – Kalman Filter
Create a Digital Compass with the Raspberry Pi – Part 1 – “The Basics”
Create a Digital Compass with the Raspberry Pi – Part 2 – “Tilt Compensation”
Create a Digital Compass with the Raspberry Pi – Part 3 – “Calibration”
These cover both BerryIMU and displaying graphics with SDL on a Raspberry Pi;
How to Create an Inclinometer using a Raspberry Pi and an IMU