Delay or Stop program when uploaded to PBASIC
WD
Posts: 3
Hello, I tend to make things complex and go into too much detail, so throw something at me if I do or you become lost or don't understand my jib-jib, but here's my problem.
Every time I turn the power on to my Boe-Bot my program I wrote starts to run, so is there a way to prevent this? Such as a way for the Boe-Bot to count the number of resets. One reset would return a 0 or a number of resets and I could use this number to determine if the Boe-Bot was just turned on or not. Also I don't know if this would work for when I am testing the Boe-Bot while its on and I am updating/uploading my new code as this would throw off the reset counter. Am I right?
So I guess what I'm asking is...is there a way to delay my code from running until I myself press the reset button on the Boe-Bot. There simply said.
Told you I'd make it complex/confusing
Every time I turn the power on to my Boe-Bot my program I wrote starts to run, so is there a way to prevent this? Such as a way for the Boe-Bot to count the number of resets. One reset would return a 0 or a number of resets and I could use this number to determine if the Boe-Bot was just turned on or not. Also I don't know if this would work for when I am testing the Boe-Bot while its on and I am updating/uploading my new code as this would throw off the reset counter. Am I right?
So I guess what I'm asking is...is there a way to delay my code from running until I myself press the reset button on the Boe-Bot. There simply said.
Told you I'd make it complex/confusing
Comments
However, you could add another pushbutton switch to your Boe-Bot and monitor it for a button press. The button-handling subroutine could be written to start & stop your Boe-Bot. You would need to periodically check for a button press to keep it responsive.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
And finally how do you know so much about the Boe-Bot and its programing language as I see your postings everywhere. Are you fluent with programming languages or is the Boe-Bot a hobby? I'm just curious.
Thanks again guys!!!
Normally you put one PBasic statement per line of a program. The colon (":") simply substitutes for the end of one line and the beginning of the next so you can put more than one statement on a line. That's all. The only exception that I recall is that a comment extends to the end of the line. Any colon found after a comment starts is treated as part of the comment.
I've been using Stamps (and Propellers) for a number of years. I've been programming for over 45 years.
Have a look at all the tutorials that Parallax has available. Good introductory tutorials include:
What's a Microcontroller?
Robotics with the BoeBot.
BASIC Stamp Syntax and Reference Manual
Look here: www.parallax.com/tabid/440/Default.aspx
and here: www.parallax.com/tabid/535/Default.aspx
There's also lots of good information here:
www.parallax.com/tabid/272/Default.aspx
Post Edited (Mike Green) : 1/25/2010 5:56:46 AM GMT