
Arduino 舵机
舵机
舵机是一种非常有意思的,多级齿轮增大扭力的widget。非常有用。在很多方面。
Servo is very useful. Now Please check this out : What is Servo Control (from wikipedia)
Variations
When a pulse is sent to a servo that is less than 1.5 ms the servo rotates to a position and holds its output shaft some number of degrees counterclockwise from the neutral point. When the pulse is wider than 1.5 ms the opposite occurs. The minimal width and the maximum width of pulse that will command the servo to turn to a valid position are functions of each servo. Different brands, and even different servos of the same brand, will have different maximum and minimums. Generally the minimum pulse will be about 1 ms wide and the maximum pulse will be 2 ms wide.
See also
Now we go to implement it on Arduino.
Strongly it is recommended that you NEED A 9V~1A ADAPTER to do this experiment.
本次实验的器材非常简单,arduino控制板一个,标准舵机一个,电池盒(外接电源)一个。(一定要使用外接电源,直接使用USB供电,有烧毁USB的危险。)
先上硬件连接图
然后把下面代码编译,下载进入arduino控制板中。(感谢坏鸟童鞋提供的代码)
需要查看的东西ASCII表:
ARDUINO 代码:
点击下图箭头指示按钮,打开串口监视器。
完成,就可以观察自己的实验结果了。
