xiugai

Dependencies:   mbed

Revision:
2:73237ebf0640
Parent:
0:c7f4744deec3
Child:
3:970c2fa6ef3f
--- a/PCA9685.h	Fri Jul 24 09:03:58 2015 +0000
+++ b/PCA9685.h	Thu Oct 24 08:21:43 2019 +0000
@@ -77,23 +77,23 @@
 class PCA9685
 {
 public:
-    PCA9685(PinName sda, PinName scl, int addr = 0x80);
+    PCA9685(PinName sda, PinName scl);//定义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,int addr);//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