-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
example of using servo? #148
Comments
The is an example in the examples directory: https://github.com/firmata/firmata.js/blob/master/examples/servo-config.js. Regarding servo.read(), I'm soliciting feature requests for a new Firmata Servo 2.0 api here: firmata/protocol#78. So please add a request there. |
@soundanalogous Thanks for your comment. I have commented something of Servo 2.0 api under your request, hopefully it would make sense. |
servo.read() doesn't actually read the servo hardware, all it does is return the present position computed in terms of the latest tick in microseconds. The present position is always whatever your program last told it to be, so your code always knows exactly what it last wrote to the servo. |
@rwaldron Thanks for pointing out my misunderstand of servo.read(). Here is the description of it from Arduino official site. |
There is no guarantee the value returned by |
My summary was based on a review of Servo library source, to determine how it implemented |
I have known firmata.js providing servoWrite(pin, degree) and servoConfig(pin, min, max) to control a servo, can anyone give an example of using servoConfig api? On the other hand, why there is no any api of reading servo's degree, like servo.read() function provided in Arduino? Thanks.
The text was updated successfully, but these errors were encountered: