guides that doesnt guide at all.
'
[ Main Routine ]
FOR counter = 1 TO 100 ' Deliver 100 forward pulses
PULSOUT ServoLeft, 850
PULSOUT ServoRight, 735
PAUSE LowTime
LOOP
DEBUG "Done!", CR, ' User instructions
"Press/release reset", CR,
"twice to restart...", CR
END
- I dont know why but I keep getting "undefined symbol" on the LowTime I am just doing what the book has told me to do. can someone help please!. thats for the sumo bot programing.
[ Main Routine ]
FOR counter = 1 TO 100 ' Deliver 100 forward pulses
PULSOUT ServoLeft, 850
PULSOUT ServoRight, 735
PAUSE LowTime
LOOP
DEBUG "Done!", CR, ' User instructions
"Press/release reset", CR,
"twice to restart...", CR
END
- I dont know why but I keep getting "undefined symbol" on the LowTime I am just doing what the book has told me to do. can someone help please!. thats for the sumo bot programing.
Comments
That error is caused when you do not have a CON statement declaring the LOWTIME constant. I assume you are referring to Applied Robotics with the Sumobot as this code is referenced on page 22. Also on that page is the note to add the CON statement:
√ Add a LowTime constant declaration: LowTime CON 20
Do you have that in your code as well?
Full code from book:
' -----[ Program Description ]------------------------------------------------ ' Applied Robotics with the SumoBot - ForwardLowTimeTest.bs2 ' SumoBot goes forward indefinitely. Use the Reset button to start and stop ' the forward motion. ' ' {$STAMP BS2} ' {$PBASIC 2.5} ' -----[ I/O Definitions ]--------------------------------------------------- ServoLeft PIN 13 ' Left servo connected to P13 ServoRight PIN 12 ' Right servo connected to P12 ' -----[ EEPROM Data ]-------------------------------------------------------- RunStatus DATA 0 ' Start with program not running ' -----[ Constants ]---------------------------------------------------------- LowTime CON 20 ' Try 1 SumoBot with 20 ms pulses ' Try the other with 40 ms pulses ' -----[ Variables ]---------------------------------------------------------- temp VAR Byte ' Temporary variable counter VAR Byte ' FOR...NEXT loop counter ' -----[ Initialization ]----------------------------------------------------- DEBUG CLS ' Clear the Debug Terminal READ RunStatus, temp ' read current status temp = ~temp ' invert status WRITE RunStatus, temp ' save for next reset IF (temp > 0) THEN ' 0 -> End, 1 -> Main routine DEBUG "Press/release Reset..." END ENDIF DEBUG "Main program running...", CR ' Display program status ' -----[ Main Routine ]------------------------------------------------------- DO ' Forward pulses indefinitely PULSOUT ServoLeft, 850 PULSOUT ServoRight, 650 PAUSE LowTime
FYI: It is against the forum rules to double post, so I will remove your other thread with the same question.
And lastly, a tip on posting code on the forums: