Open occasl opened 10 years ago
Somehow, I just noticed this issue. Sorry about the delayed response @occasl perhaps @edgarsilva can check this one? It is still a problem?
Will add the necessary code, sorry for the late response.
I've just run into this issue as well with a Particle Photon. rotate('clockwise') works fine, but rotate('counter-clockwise') does nothing.
@edgarsilva any update?
@ericterpstra haven't had a chance to check it out, will try to make some time this weekend and fix up, must be that the value is not low enough to make it counter-clockwise. Two things, can you provide the servo model you are using so I can check the pulse-width values.
In the meantime you can try to use the servo driver which accepts values from 0-180, that way you can test that passing a value between 0-89 makes the servo rotate counter-clockwise. 89 is the default value in continues-servo
driver maybe an 80?
That would give you enough flexibility to test your code. I will check it out myself and try to post an update this weekend.
@ericterpstra an example using servo driver:
https://github.com/hybridgroup/cylon-firmata/blob/master/examples/servo/servo.js#L25
@edgarsilva Thanks for the quick reply! I fiddled with the continuous-servo.js module and set the non-clockwise value to 0, which got it working.
Using your example code above, the servo puttered along ccw at 60, then at 40 or below worked normally. Testing on my own, anything from 0-40 worked ok.
My servo model is: SpringRC SM-S4303R
@ericterpstra that's great! do you wanna submit a PR? I can merge afterwards, then the only issue is that the lower the value the faster it goes backwards, we have it setup for 89 which as you mentioned is not enough for it to spin backwards.
Let me know, if you are otherwise busy I'll fix the code later today.
@ericterpstra Thanks for the fix. That's what I was looking for the last couple of days. But after applying your fix, I can't get it work the "stop" method for continuous servo. Do you have any ideas? Do you have any problems on your side with the stop method?
@goeker have you tried the full range of values with the servo driver? same as @ericterpstra did to check what values made his servos go backwards and stop, that might help figure out what the range for your servos is. I can arrange for custom thresholds to be passed to the driver after we have some sensible defaults.
I'm trying to write a simple cylon.js program to make a nodebot spin around in circles and alternating directions every second. With the program below I get it to spin, but it will not alternate directions. The output in the console shows that it is attempting to switch the servos cw/ccw but the nodebot continues to go in one direction.
Thinking something was up with my servos, I verified this worked with JohnnyFive so I'm not sure why cylon.js won't work.
Any ideas?