
amstel_1998
USA
Asked
— Edited
I'd like to be able to make a servo oscillate back and forth for a set number of cycles. For example, I'd like to be able to edit a script and tell it to cycle 100 times. Another time I'd like to be able to go back in and have it cycle 1000 times. Is there an easy way to do this? (NEWBIE here) -Thanks in advance!
Code:
Correct me if I am wrong, but that script is a continuous cycle with no exit
Wouldn't you need to have a IF-THEN-ELSE with an incremented counter for x100 cycles/loops ?
if(servo, d6 > 50)
ServoSpeed(d5, 3)
:Loop
Servo(d5, 10)
Sleep(3000)
Servo(d5, 70)
(enter if command here aswell to "stop it")
goto(Loop)
i think....havent been in the "lab" for a while now.
I also have it setup to run from a voice command. Or from an EZ-Script command.
Right Click Save As: SweepServoExample.EZB
And here is a copy of the code from the c# script control
Code: