Need help with this Loop. Its not doing what its supposed to
' {$STAMP BS2} ' {$PBASIC 2.5} '{1 to 6 with a pause 20 is equivalant to 1 inch) irDetectLeft VAR Bit pulseCount VAR Byte pulseLeft VAR Word pulseRight VAR Word loopCount VAR Byte irDetectMiddle VAR Bit hit VAR Nib finish CON 4 'Just a constant of if a square is made turn VAR Nib 'Will increase if a full corner turn is predicted 'measure VAR Byte 'Variable for distance in inches DO FREQOUT 8, 1, 41500 irDetectLeft = IN10 FREQOUT 2, 1, 41500 irDetectMiddle = IN0 IF (irDetectMiddle = 0) THEN DO PULSOUT 13, 850 PULSOUT 12, 800 LOOP UNTIL (irDetectLeft = 0) =====more code=======
Basically, it stays in an infinite loop. not sure why at all. Its just a boe-bot with 2 Irs.
Post Edited (Statz) : 11/13/2008 4:39:56 AM GMT
Comments
You may want to rethink the whole thing (where the IR detection fits into the movement logic).
You really didn't say what you're trying to accomplish with the program. That helps when you ask a question.
That makes sooooooooooooooooooooo much sense
lol! how simple. I kept revising my code. Thanks, that basically solved the whole problem
Joking of course,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i