Example using the Acceleration & Tilt  Sensor for VEX
Go to Home Page

This page shows an example using the Acceleration & Tilt Sensor for VEX.                  

In this example you will make your robot go up a hill and stop at the top. It will use the the Accel/Tilt sensor to determine when it is going uphill and when it has reached the top. This is intended as a programming example only. You will probably need to modify the program to make it work with your robot.

First build a hill for your robot to climb. An easy way is to use cardboard as shown in the picture below. The one below has a flat cardboard box under the middle to hold it up.

Next find which side of the sensor will cause the channel #1 value to increase when you tilt that side up. . To do this connect the sensor to ports 1and 2 on the VEX computer analog/digital connector. Plug the sensor connector with a white dot into channel 1 on the VEX. Connect the VEX computer to your personal computer using the serial port cable. Start the “Intelitek EasyC for VEX” program. Click on the “Build and Download” menu and select “Terminal Window”. Select the “Online” tab. (You may need to download the online code) Turn on the VEX computer. It should now display all the port values. You may want to connect a touch sensor to make sure the program is working. Rotate the ACCEL sensor. You should see the values change in the windows for sensor 1 and 2. Place the sensor on a flat surface and then tilt it to lift one side. Watch the values in the terminal window. Find which side causes the channel 1 value to increase when you lift it. Mark this side of the sensor with a piece of tape.

Build a robot capable of going up the hill. Any robot will work for this example You can use a modified “square-bot” robot shown in the VEX documentation. In the photo below note one one pair of wheels is larger. If you use only small wheels on the square-bot, the gears will hit the edge of the cardboard as it reaches the top. Note that only one channel of the sensor is used. Be sure you use channel #1or have both channels plugged in if you are using channel #2. Also note the sensor has a small piece of foam rubber under it to help reduce vibration from the motors.

Write, compile, and download the program shown in the .pdf file below. This program assumes the robot is starting on a level surface. The program first looks for an increase in angle, indicating the robot is going uphill. Then it looks for a level reading. When it finds the level reading it turns off the drive motors. (When the robot is at the top of the hill it will be level)

The program uses a smoothing algorithm to reduce the detected vibration from the motors. This algorithm lets each sensor measurement change an "average" value by only 10 percent. You may want to change the percentage for better results with your robot.


Download the demo program flowchart in .pdf format


Download the Easy C code for the demo program.


Download the User's guide for this sensor.


 

black infrared 13s black infrared 23 13s jordan 13 black infrared 23 legend blue 11s jordan 11 legend blue jordan 13 black red jordan 11 legend blue legend blue 11s jordan 11 legend blue legend blue 11s jordan 13 black infrared 23 jordan 11 legend blue black infrared 23 13s legend blue 11s legend blue 11s black infrared 23 13s legend blue 11s black infrared 23 13s jordan 11 legend blue jordan 13 black infrared black infrared 13s legend blue 11s jordan 11 legend blue black infrared 13s jordan 11 legend blue legend blue 11s legend blue 11s jordan 13 black infrared 23 legend blue 11s legend blue 11s jordan 13 black infrared legend blue 11s jordan 11 legend blue jordan 13 black infrared 23 black infrared 13s legend blue 11s jordan 11 legend blue jordan 11 legend blue jordan 13 black infrared jordan 13 black infrared 23 michael kors black friday michael kors black friday michael kors black friday michael kors Black Friday michael kors black friday uggs Black Friday hollister black friday Abercrombie and fitch cyber monday canada goose cyber monday canada goose black friday moncler black friday Tiffany black friday bose cyber monday bose cyber monday gucci black friday burberry black friday uggs cyber monday kate spade black friday uggs cyber monday north face cyber Monday kate spade cyber monday uggs cyber monday michael kors black Friday moncler black friday uggs cyber monday michael kors cyber monday victoria secret black friday uggs cyber monday beats by dre black friday coach cyber monday beats by dre black friday beats by dre cyber Monday uggs black friday canada goose black friday uggs black Friday north face black Friday lululemon cyber monday north face black friday black Friday beats by dre beats by dre cyber Monday moncler black friday uggs black friday Hollister cyber Monday uggs cyber monday lululemon black friday uggs black friday uggs black friday uggs cyber monday uggs black friday mcm cyber monday uggs black friday lululemon black friday uggs black friday uggs black friday black friday jordans uggs cyber monday coach cyber monday tod's cyber monday canada goose cyber monday kate spade black friday uggs cyber monday uggs cyber monday michael kors black Friday bose black friday north face black friday uggs black friday Ray Ban black Friday north face cyber monday beats by dre cyber Monday Miumiu cyber Monday beats by dre cyber Monday moncler black friday lululemon cyber monday canada goose black friday Longchamp black friday michael kors cyber Monday north face black friday uggs cyber monday beats by dre cyber Monday Versace cyber Monday beats by dre black Friday tory burch cyber Monday michael kors black Friday moncler cyber monday the north face cyber monday michael kors black Friday michael kors black friday uggs cyber monday uggs cyber monday uggs black friday uggs cyber monday uggs black friday michael kors black Friday uggs black friday michael kors black Friday uggs cyber monday michael kors cyber Monday beats by dre black Friday beats by dre black friday north face cyber monday michael kors cyber Monday north face black friday beats by dre cyber Monday north face cyber monday beats by dre cyber Monday beats by dre cyber Monday michael kors black friday michael kors black friday michael kors black friday uggs cyber monday michael kors cyber monday michael kors black friday michael kors black friday uggs cyber monday michael kors black friday michael kors cyber monday uggs black friday uggs black friday north face cyber monday north face cyber monday north face cyber monday north face cyber monday north face cyber monday north face black friday uggs black friday north face black friday