Go to Post That Billfred guy is going to pay for this one. - Bcahn836 [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 06-02-2004, 23:23
Argoth Argoth is offline
Registered User
AKA: The Prez
#1255 (Team Blarglefish)
 
Join Date: Oct 2003
Rookie Year: 2004
Location: Texas
Posts: 41
Argoth can only hope to improve
IR reflective (tape) sensor code problems

Ummmm.... this will probably make me look really stupid, but part of my team has been playing with the EDU bot's Reflective IR sensors. I was told to program it, but I encountered a problem (why else would I be here? lol). For 15 seconds the bot is supposed to follow the line using two sensors (to eliminate the need for two seperate autonomous modes). Except my program completly skips that step and waits for 15 seconds, then goes to the bumper sensor code that is later on in the program.

/*right sensor= rc_dig_06
left sensor=rc_dig_08
bumper sensor=rc_dig_10*/

int counter=0;
short endprogram=0;

void Default_Routine(void)
{
counter++;
if((endprogram==0)&&(counter<900))
{
if((rc_dig_in06 !=0)&&(rc_dig_in08 !=0))/*if light is seen*/
{
pwm01=pwm03=255; /* turn left motors on */
pwm02=pwm04=0; /* turn right motors on*/
}
else if(rc_dig_in06 == 0) /* if dark is seen */
{
pwm01=pwm03=127; /* turn left motors off */
pwm02=pwm04=67; /* turn right motors forward slowly */
}
else if(rc_dig_in08 == 0) /* if dark is seen */
{
pwm01=pwm03=187; /* turn left motors forward slowly */
pwm02=pwm04=127; /* turn right motors off */
}
}


Can anyone tell me my problem?? PLEASE!!!
__________________
BEWARE OUR ROBOT, It has serious anger issues. Prone to attack whatever is infront of it randomly! Tried to cut our sponsors jugular!

"A common mistake that people make when trying to design something completly foolproof was to underestimate the ingenuity of fools." ~Douglas Adams~
 


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
Trade retro reflective tape sanddrag Technical Discussion 0 07-02-2003 19:53
reflective tape esellers Technical Discussion 8 22-01-2003 19:10
Reflective tape on boxes S2Taz General Forum 1 20-01-2003 17:24
How is reflective tape applied to HP crates? Dr.Bot General Forum 2 06-01-2003 15:17
Substitutes for reflective tape? Oakridege_665 Technical Discussion 1 23-01-2002 11:44


All times are GMT -5. The time now is 16:54.

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