Go to Post A wet noodle of a chassis won't matter how much drop you have. - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-05-2006, 17:57
jbill30 jbill30 is offline
Registered User
no team
 
Join Date: Mar 2006
Location: Gilford, nh
Posts: 4
jbill30 is an unknown quantity at this point
Bumper sensors

How do I get the bumper sensors torun the course that is suggested in the VEX programming section of the Manuaul. The robot should hit an object go left, hit an object go right, hit another object go right, hit another object go left and stop after a short period of time. if anybody has a code for this or can give me a sample code for this it would be a big help.

thank you.
  #2   Spotlight this post!  
Unread 01-05-2006, 18:49
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,011
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Bumper sensors

I'm not going to give you the code, but i'll give you some hints. Try them, see what happens, tweak... All this asusmes a squarebot.

For autonomous behavior, you need to set up a WHILE loop. I'd suggest making the parameter equal to "1==1", which means "While 1 is equal to 1, do this". Since 1 is always equal to 1, it does that forever.

Next, define a variable to hold the state of the bumper switch. Use an Integer (INT)

As the first thing in the WHILE loop, set the two motors so the bot drives forward.

You need a second loop inside the first. Check for the value of the bumper switch inside this loop. WHILE the bumper switch is not pressed, keep moving forward - as soon as it gets pressed, turn left (both motors have the same value, like 255 or 0, and WAIT a few hundred microseconds for the turn to complete), then drop out and move forward again.

A second loop, but this time when the bumper switch is pressed turn right. And so on.

Try to make the first part - turn left after hitting the bumper and move forward again - work well, and that can be almost copied 100% for all the other turns.

Good luck, and post your code, working or not.

Don
__________________

I am N2IRZ - What's your callsign?
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
where can we buy hall effect sensors or gear tooth sensors amirjpl Electrical 3 13-02-2006 11:02
bumper customization? gondorf General Forum 20 01-02-2006 19:30
jumper cabling from sensors to controller Gary Dillard Electrical 4 23-12-2005 07:42
Bumper sensors jeffmorris FIRST Tech Challenge 1 02-10-2005 16:20
Why not analog sensors?? gnormhurst Programming 16 07-03-2004 16:14


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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