|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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: |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| The 9:43 PM Server Bug | sanddrag | CD Forum Support | 11 | 12-11-2003 19:13 |
| Last Call for bug reports | rbayer | Programming | 0 | 08-01-2003 02:48 |
| SOCKS ???? | archiver | 2001 | 3 | 24-06-2002 02:09 |
| Popularity of this site... | archiver | 2000 | 16 | 23-06-2002 22:42 |
| Small bug | Jay Lundy | CD Forum Support | 1 | 18-06-2001 17:03 |