|
发表于 2013-11-3 16:28:11
|
显示全部楼层
感谢弘毅的解说, 原本还在想为何Arduino的Servo无法控制舵机 0~180度转动, 后来发现原来是 libraries/Servo/Servo.h的定义限制了舵机行程.
把 #define MIN_PULSE_WIDTH改为500, #define MAX_PULSE_WIDTH改为2500便可以转180度了 !!
原始的libraries/Servo/Servo.h 如下: (544~2400 uSec)- #define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo
- #define MAX_PULSE_WIDTH 2400 // the longest pulse sent to a servo
- #define DEFAULT_PULSE_WIDTH 1500 // default pulse width when servo is attached
- #define REFRESH_INTERVAL 20000 // minumim time to refresh servos in microseconds
复制代码 |
|