Interfacing the IR, Sonar and Accelerometer

Today we got the sonar working. It didn't take a lot of time because the code was almost identical to the IR rangefinder. Also, the equation for converting the analog value to distance is linear so it's even easier. The accelerometer also uses analog to digital so we started on that too. We got a lot of problems with the values it was outputting because they were inconsistent and jumping all over the place. We solved this by adding a decoupling capacitor to the accelerometer's power supply and incorporating averaging into our code. I can tell already that the equation for getting speed from acceleration using this thing isn't going to be easy at all.