
Bookmaker
USA
Asked
— Edited
Some of my servos work with the servospeed command and some don't.
When I run this scriptCode:
servospeed(d15,5)
servo(d15,1)
sleep(2000)
servospeed(d17,5)
servo(d17,100)
sleep(2000)
servospeed(d16,5)
servo(d16,1)
Only servo d17 runs slow. Both of the other two run at full speed. The servos are the same brand. I thought it was part of the bug but it is still doing it.
Each control is responsible for moving a servo. It's like time sharing. So when you're using Scripting, the position is always the same. Position 1 is always position 1.
Code:
Same result. Only one ran slow. Other two ran at max speed.
Each control is responsible for moving a servo. It's like time sharing. So when you're using Scripting, the position is always the same. Position 1 is always position 1.
You cannot invert a servo in script. I can't say it any differently.
Your code keeps putting the position to 1, and that's the starting position. So if you change your code to move the servos to position 100, you will see the speed.
Code:
Just got home from work. I copied your script and tried it and I got the same results. So I copied it and put it into a new control and deleted the onld one and now everything is fine. Thank you for all your help and patients.
Methinks you snuck one in on us! I don't find :LOOPSTART in the ARC manual; but I entirely get it! Kinda sneaky.....................you're going to teach some of to write code whether we know it or not. I'm back to lurking.................... Really enjoying "High Five". So much more we can do now. I'm at the point where I'm ready to start mounting componets on Gizmo. Next is the batteries and motor driver. BTW On the L289N driver is the ENA and ENB the pins to put the PWM on??????? Will be posting progress photos as I go. I got my Camcorder out yesterday. Believe it or not I'm going to attemp to do a video.
Lloyd
As for your PWM on the motor controller, connect a Digital I/O Port from the EZ-B to both Enable connections on the LN298. There will be 2 jumpers, 4 pins for the Enable on the LN298. Two of those pins are Enable, and the other 2 are +5. You can verify by using a volt meter of which is which.