Step 7: Accelerometer (Optional)
Before attaching it run a simple program that reads the accelerometer values and prints them to the screen. Find the direction that the accelerometer should be held at to get the greatest value. Then turn the accelerometer a complete 180 degrees and you should be getting the minimum value that the accelerometer will read. My max was around 600 and my min was around 400, but yours could be quite different! Write these down as you will need them for calibrating the robot in the processing sketch.
When you mount it to the robot, make sure that it will give this maximum reading when the robot is attached to the wall and "looking up" or pointed to climb upwards on the window.
To give a little more information on how this is used, the arduino code reads the accelerometer value every millisecond and uses a buffer by averaging 20 of these values before using the averaged value as the robots "current" position in the code. Using this filter my robot turns exact angles to within about 3 degrees (tough to estimate) of the desired value. This small imprecision is most likely due to the motors slowing down before stopping for an extremely short time after they have been set to neutral.
Remove these ads by
Signing Up


























Not Nice















Visit Our Store »
Go Pro Today »



