Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Bumper Sensor Question (http://www.chiefdelphi.com/forums/showthread.php?t=59305)

diaperrash89 25-10-2007 19:11

Bumper Sensor Question
 
Hello,

We finally got our vex robots up and running and we've just done some pretty basic programming right now. So far our school has just a few sensors, bumpers being one of them. While we're just kicking off this robotics program, we're not so sure how to program the bumpers. I know how to put in the digital input and what not. Do we just have to tell the bumpers to get the digital input? Basically we want to tell it if the bumper is pushed, go the other way.. Advice? thanks.

artdutra04 25-10-2007 23:09

Re: Bumper Sensor Question
 
Quote:

Originally Posted by diaperrash89 (Post 648011)
Hello,

We finally got our vex robots up and running and we've just done some pretty basic programming right now. So far our school has just a few sensors, bumpers being one of them. While we're just kicking off this robotics program, we're not so sure how to program the bumpers. I know how to put in the digital input and what not. Do we just have to tell the bumpers to get the digital input? Basically we want to tell it if the bumper is pushed, go the other way.. Advice? thanks.

Check out the Programming section of the Vex Inventor's Manual, which is available as a PDF download from the Vex programming page at Vex Labs. This PDF is a great introduction to using Vex sensors with EasyC, and has specific examples of code that makes a robot back up if it something hits the bumper switch.

Chief Pride 26-10-2007 06:17

Re: Bumper Sensor Question
 
get digital input into a variable, the variable will be an unsigned char, then if the value of the variable is 1, the button is pushed, if it is 0, it is not

Roger 26-10-2007 06:48

Re: Bumper Sensor Question
 
Here is a screen shot of a Limit Switch test I had done. (I'm assuming you're using easyC for Vex.) Limit Switches are the same as Bumpers, just more sensitive and less durable, and the pretty easyC icon is different. The limit variable is an int. Change Digital Input number to suit, add PrintToScreen's to test the alternate conditions, and add SetMotor's to taste.

If I remember, there was some code that, if front bumper was hit, drive motors backwards and turn left 90 degrees, else let the driver drive the motors.

And, yes, check out the Vex PDF for the full explaination. I just get impatient reading it sometimes.


All times are GMT -5. The time now is 00:18.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi