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.
Dependents: qonly_controller foc-ed_in_the_bot_compact foc-ed_in_the_bot_compact CurrentModeSine ... more
Fork of FastPWM by
Diff: FastPWM.cpp
- Revision:
- 2:4b8de6ae5885
- Parent:
- 0:f8c1b0ad5371
- Child:
- 3:3094d3806cfc
diff -r 1aed61747ed6 -r 4b8de6ae5885 FastPWM.cpp
--- a/FastPWM.cpp Thu Jul 12 11:23:31 2012 +0000
+++ b/FastPWM.cpp Thu Jul 12 19:26:43 2012 +0000
@@ -28,15 +28,15 @@
}
void FastPWM::period_ms(int ms) {
- period((double)ms*1000.0);
+ period((double)ms/1000.0);
}
void FastPWM::period_us(int us) {
- period((double)us*1000000.0);
+ period((double)us/1000000.0);
}
void FastPWM::period_us(double us) {
- period(us*1000000.0);
+ period(us/1000000.0);
}
void FastPWM::pulsewidth(double seconds) {
@@ -44,15 +44,15 @@
}
void FastPWM::pulsewidth_ms(int ms) {
- pulsewidth((double)ms*1000.0);
+ pulsewidth((double)ms/1000.0);
}
void FastPWM::pulsewidth_us(int us) {
- pulsewidth((double)us*1000000.0);
+ pulsewidth((double)us/1000000.0);
}
void FastPWM::pulsewidth_us(double us) {
- pulsewidth(us*1000000.0);
+ pulsewidth(us/1000000.0);
}
void FastPWM::write(double duty) {
