No Subject
I'm sure this question has been asked, but there are so many responses in the search that it'd be near impossible to find the answer.
I just got started with the HomeWork board (BS2, PBASIC 2.5) and I am loving it. One annoying thing, however, is that in order to stop a program from running, I must either:
-Unplug the battery (but the program runs again when I plug it back in)
or
-Run a program with just the END command.
The reset button only starts the program over. For looping programs, this is not ideal. Is there a way to just "turn off" a running program without unplugging the power source?
Post Edited (JerryShaw) : 12/28/2009 2:09:10 PM GMT
I just got started with the HomeWork board (BS2, PBASIC 2.5) and I am loving it. One annoying thing, however, is that in order to stop a program from running, I must either:
-Unplug the battery (but the program runs again when I plug it back in)
or
-Run a program with just the END command.
The reset button only starts the program over. For looping programs, this is not ideal. Is there a way to just "turn off" a running program without unplugging the power source?
Post Edited (JerryShaw) : 12/28/2009 2:09:10 PM GMT
Comments
How about modifying the program to run when a particular pin is 'high' and stop running when that pin is 'low'? The pin could be forced high by connecting it to +5V through a 10K resistor, and forced low by connecting it to 0V (ground) through the same resistor. The pin would have to be set as "input" for this to work properly. The connection could be made by moving a wire or by an SPDT switch.
Regards,
DJ
P.S. I would suggest that you edit your original post and give the thread a subject.· That helps others in deciding whether to read the thread or not.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
As davejames mentioned, you can write your program so it requires a switch to be set for the rest of the program to be executed. If you're always going to have your board connected to your PC, you can add a DEBUGIN statement to the beginning of your program to require a character or number to be sent from the PC, like a "G" for "go" or a number to indicate what function to perform. It helps to use a DEBUG statement with the DEBUGIN statement so you can tell what the Stamp program is doing ... a prompt for the character or number.