Basically, I want to say, emphatically, "Yes, you can," but right after doing so you're going to drop the other shoe and change all that.· So, what's up Doc?· What's the big(ger) picture?· More details, please.
That's it...all i want to do is make a loop that will allow me to run a servo for a certain amount of time and I just need to know how to do it. I have a boe-bot that I need to operate for a certain time unless the reset button is pushed.
OK (you provided more info).· I'm not a real DO...LOOPer, but here's what I'd do:
FOR A = 0 TO 2000
IF INPUT = 1 THEN ZAP
PAUSE 10
A = A + 10
NEXT
ZAP:
stops the servo
You start the servo running before executing this routine.· It will run for about 2 seconds.· It checks for an INPUT every 10msec.· If it gets an INPUT then it goes to "ZAP" and turns off the servo.· If it runs to the end of A (2000), then it falls through to "ZAP".
Since I run a servo from an oscillator with a variable PW· that I enable/disable (I do different things), looking at it closer, you should make the SERVO-kick part of the routine.· It'll recur within the refresh time.
Comments
You start the servo running before executing this routine.· It will run for about 2 seconds.· It checks for an INPUT every 10msec.· If it gets an INPUT then it goes to "ZAP" and turns off the servo.· If it runs to the end of A (2000), then it falls through to "ZAP".
http://forums.parallax.com/showthread.php?p=550292
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
································································· ·
Here is the DS1302 as a countdown timer and this the·routine that i used named
DS1302_VCR_Camera2.bs2 in the Attachment below
I also have this routine· DS1302_Camera_1.bs2 Attachment below
I hope this helps you in what you want to do
Sam
······································································