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: A3921_2p.cpp
- Revision:
- 2:918eefae7a4e
- Parent:
- 1:3ea68f4a0556
- Child:
- 3:e40b9af046b8
--- a/A3921_2p.cpp Thu Jul 15 12:31:11 2021 +0000 +++ b/A3921_2p.cpp Thu Jul 15 14:33:02 2021 +0000 @@ -22,8 +22,18 @@ } -void A3921_2p::SetPeriod(float p){ - period = p; +void A3921_2p::SetPeriod(float val){ + period = val; + PWM_L.period(period); +} + +void A3921_2p::SetPeriod_ms(int val){ + period = (float)val/1000; + PWM_L.period(period); +} + +void A3921_2p::SetPeriod_ms(float val){ + period = val/1000.0f; PWM_L.period(period); }