View Single Post
  #1   Spotlight this post!  
Unread 16-02-2003, 00:53
Tazlikesrobots's Avatar
Tazlikesrobots Tazlikesrobots is offline
Jack of all trades...Master of none
AKA: Robert
FRC #1745 (P-51 Mustangs)
Team Role: Coach
 
Join Date: Feb 2003
Rookie Year: 2000
Location: Rowlett, Texas
Posts: 205
Tazlikesrobots has much to be proud ofTazlikesrobots has much to be proud ofTazlikesrobots has much to be proud ofTazlikesrobots has much to be proud ofTazlikesrobots has much to be proud ofTazlikesrobots has much to be proud ofTazlikesrobots has much to be proud ofTazlikesrobots has much to be proud ofTazlikesrobots has much to be proud of
Send a message via Yahoo to Tazlikesrobots
Question Bug in IR sensor code

I got a problem with my IR sensors code. Everything works ok until the robot reaches the end of the white line. I thought i'd be cleaver and wrote an if statement that says if rc_sw 1,2 & 3 =0 then go straight, however the robot goes into a left hand loop.

Any help or suggestions would be greatly appreciated!!

Here is the code I wrote:

FullAutoMode:

if rc_sw2=1 then straight:
if rc_sw1=1 & rc_sw3=0 then turnleft:
if rc_sw3=1 & rc_sw1=0 then turnright:
if rc_sw1 & rc_sw2 & rc_sw3=0 then straight:
goto endir:
straight:
debug "staight",cr
p1_y = 234
p3_y = 254
goto endir:

turnleft:
debug "left",cr
p1_y = 84
p3_y = 127
goto endir:

turnright:
debug "right",cr
p1_y = 127
p3_y = 84
goto endir:





KillAuto:

endir:
__________________
It is all mind over matter....If you don't mind, it does not matter.
_________________
2006 Woodie Flowers Award Recipient - Lone Star Regional
2006 Rookie All-Star - Lone Star Regional
2007 Lone Star Regional Champions
2008 Quarter-finalist - Lone Star Regional
2009 Chairman's Award & Website Award - Dallas Regional
2009 Quarter-finalist - Dallas Regional
2010 - Xerox Creativity Award & Semi-finalist - Dallas Regional