![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
制造工程实践使用
Diff: PCA9685.h
- Revision:
- 2:1d858fcb3cb5
- Parent:
- 0:c7f4744deec3
diff -r 7f3c3ac6b20b -r 1d858fcb3cb5 PCA9685.h --- a/PCA9685.h Fri Jul 24 09:03:58 2015 +0000 +++ b/PCA9685.h Thu Oct 24 06:30:59 2019 +0000 @@ -77,23 +77,23 @@ class PCA9685 { public: - PCA9685(PinName sda, PinName scl, int addr = 0x80); + PCA9685(PinName sda, PinName scl, int addr = 0x80);//定义pca9685 地址为1+A5+A4+A3+A2+A1+A0+rw rw写为0 读为1 void frequencyI2C(int freq); - void begin(void); //Initialize the controller - void reset(void); //Reset the controller - void setPrescale(uint8_t prescale);//setPrescale(prescale) - /** Set prescale + void begin(void); //初始化 + void reset(void); //复位 + void setPrescale(uint8_t prescale);//设置预缩放 + /** set prescale * * @param prescale: set scale for the PWM frequency * */ - void setPWMFreq(float freq);//Set the pwm frequency + void setPWMFreq(float freq);//设置PWM频率 单位hz /** Set frequency * * @param frequency in Hz * */ - void setPWM(uint8_t num, uint16_t on, uint16_t off);//SetPWM(channel, on, off) + void setPWM(uint8_t num, uint16_t on, uint16_t off);//SetPWM(通道数:0到15, 信号上升沿位置:0到4095, 下降沿位置:0到4095)不同舵机所需的上升沿到下降沿的长度不同 /** Set the start (on) and the end (off) of the part of the PWM pulse of the channel * @param channel : from 0 to 15 the channel the should be update * @param on: from 0 to 4095 the tick when the signal should pass from low to high