DOMAN舵机位置反馈的实现

DOMAN舵机位置反馈的实现Howto@DOMAN舵机位置反馈的实现DOMAN舵机位置反馈的实现HowtoTogetthecurrentangle,senda50us(microsecond)pulsetotheservomotor.These

How to@DOMAN舵机位置反馈的实现

DOMAN舵机位置反馈的实现

How to

To get the current angle, send a 50us (microsecond) pulse to the servo motor. The servo will pull the control wire high after the microseconds that represent the current position. This can be done using Arduino:

pinMode(pin, OUTPUT);
digitalWrite(pin, HIGH);
delayMicroseconds(50); // send a 50 us pulse to get the current position
digitalWrite(pin, LOW);
pinMode(pin, INPUT);
int position = pulseIn(pin, HIGH); //e.g. 500-2500

Examples

Teach and Replay

Wire the servo as shown below:
Press enter on the serial monitor (enable Carriage return) to teach the current angle. 3 angles can be teached. Press enter to replay the angles.
Press enter on the serial monitor (enable Carriage return) to teach the current angle. 3 angles can be teached. Press enter to replay the angles.

Mirror movement

Wire two servos according to
Wire two servos according to
Move the servo connected to pin 9. The servo on pin 10 should follow. Open the serial plotter to view the read angle.
DOMAN舵机位置反馈的实现

今天的文章DOMAN舵机位置反馈的实现分享到此就结束了,感谢您的阅读。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/63221.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注