Optimization of DO...LOOP and SELECT...CASE...ENDSELECT commands
chantheman1288
Posts: 1
in BASIC Stamp
Hello, this is my first time on the forums, but I'm looking for some assistance increasing the speed at which a program operates on the BS2 Stamp chip in a Board of Education Bot. I am involved in a robotics competition where we are timed in our attempt to go through a maze while crossing certain specified checkpoints. With the completion of my code and the upgrading of my servos to High-Speed Servos, my Bot now drives so fast that the SELECT...CASE command sometimes does not pick up on the markers that tell it where it is in the maze. If anyone has any general tips on optimizing the DO...LOOP or SELECT...CASE...ENDSELECT commands, that would be great, and if need be, I can post portions of my program for more detailed analysis.
Thanks!
Thanks!
Comments
In addition to Mike's suggestions, some programs lend themselves to LOOKDOWN and LOOKUP tables. SELECT..CASE in the Basic Stamp works, but generates a lot of code to handle all the details -- this has an impact on execution speed.