help bs2sx
wondering if its possible to run a program and have the bs2sx respond to a button press at anytime during the program, for example, if i wated to run three servos and a ping senser (boebot program) and include a button press to change to a run instruction to jump to a new program , what i really want to do is run the say it modual in each program slot and have the boebot program or a program for ect activated by the say it modual. the button press is easier to read for the testing phase Im just wondering if this is possable and am in the planning stages of the programming.
Comments
Because you have to specify which Stamp model you're using (with the $Stamp directive), you can use conditional compilation to adjust constant definitions for the different models. There's a section of the Manual that describes this and many of the Stamp examples use this facility.
The only way your program can respond to a button press would be to have a test (IF or BUTTON statement) for the button in every loop in the program. In the BS2p/pe/px Stamp models, there is a special set of POLLxxx statements which allow a program to respond to a signal at the beginning of any statement being executed. This can force a GOTO to the beginning of a slot, but is limited in its usefulness because there's no way to return to the place in the program that was interrupted.
http://forums.parallax.com/showthread.php?83135-One-Program-Any-BS2-family-Module-%28Conditional-Compilation%29
Also, you might look into using a ServoPal to control your wheel servos. It takes a lot of the processing load off the Stamp, allowing it to do other things instead of constantly driving the servos.
On the other hand, this is not a terribly difficult program for a Stamp as long as you use a pair of ServoPALs for the 3 servos.