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.
Diff: PCA9685.cpp
- Revision:
- 3:a6e6062dcbaf
- Parent:
- 1:dbe78e80d722
diff -r 3c6a640a1035 -r a6e6062dcbaf PCA9685.cpp --- a/PCA9685.cpp Mon Dec 14 14:59:19 2020 +0000 +++ b/PCA9685.cpp Mon Dec 14 15:18:25 2020 +0000 @@ -35,10 +35,10 @@ uint8_t oldmode = read8(PCA9685_MODE1); uint8_t newmode = (oldmode&0x7F) | 0x10; // sleep write8(PCA9685_MODE1, newmode); // go to sleep - wait_ms(5); + ThisThread::sleep_for(5ms); write8(PCA9685_PRESCALE, prescale); // set the prescaler write8(PCA9685_MODE1, oldmode); - wait_ms(5); + ThisThread::sleep_for(5ms); write8(PCA9685_MODE1, oldmode | 0xa1); } void PCA9685::setPWMFreq(float freq) @@ -73,7 +73,7 @@ cmd[3] = off; cmd[4] = off >> 8; i2c.write(_i2caddr, cmd, 5); - wait(0.0005); + ThisThread::sleep_for(1ms); } } \ No newline at end of file