hybridgroup / cylon-intel-iot

Cylon adaptors for the Intel Edison & Galileo
http://cylonjs.com
Other
35 stars 9 forks source link

No equivalent of Servo.detach() #11

Open X-Y opened 9 years ago

X-Y commented 9 years ago

To stop a continuous rotation servo, one can write 90 to it. However if the servo is of bad quality, it can be difficult to stop entirely. To fix this one can stop sending PWM pulses to the servo. In Arduino lingo it's done by calling Servo.detach(). But in Cylon there doesn't seem to be a way of stopping PWM.

As seen in https://github.com/hybridgroup/cylon-intel-iot/blob/dd72842ff24a3b5a7d68b13ed907ddbac35e4d3a/lib/adaptor.js, function servoWrite and pwmWrite

edgarsilva commented 9 years ago

We'll take a look into it. Will this be the equivalent to just send 0 to the pwmWrite? or do we actually need to change the mode of the pin to not be pwm pin anymore? like switching back to digital pin.

deadprogram commented 9 years ago

@edgarsilva anything that sets voltage to zero will effectively turn the servo "off".

edgarsilva commented 9 years ago

mmm... if I change the duty cycle of a connected servo to 0 it would probably fry it no? since it is gonna try to go as far as possible on that direction, same if I apply 1. I kind of remember that is how I burned a couple of mine.