Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Adafruit-PWM-Servo-Driver by
Revision 2:88bdd5c4e77b, committed 2013-09-04
- Comitter:
- syundo0730
- Date:
- Wed Sep 04 03:58:53 2013 +0000
- Parent:
- 1:69033d5e289b
- Commit message:
- modified about duty handling
Changed in this revision
Adafruit_PWMServoDriver.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 69033d5e289b -r 88bdd5c4e77b Adafruit_PWMServoDriver.cpp --- a/Adafruit_PWMServoDriver.cpp Mon Aug 19 08:35:11 2013 +0000 +++ b/Adafruit_PWMServoDriver.cpp Wed Sep 04 03:58:53 2013 +0000 @@ -91,7 +91,10 @@ write8(LED0_OFF_H+4*num, off >> 8);*/ } +// Set pwm duty in us order void Adafruit_PWMServoDriver::setDuty(uint8_t num, uint16_t duty) { + float pulselength = 10000; // 10,000 us per second + duty = 4094 * duty / pulselength; setPWM(num, 0, duty); }