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.
Dependencies: mbed-STM32F103C8T6 mbed
Diff: main.cpp
- Revision:
- 1:b8fb21d3836e
- Parent:
- 0:fb723d2f5d7e
- Child:
- 2:3f9a695cde1c
--- a/main.cpp Mon Apr 09 22:02:39 2018 +0000
+++ b/main.cpp Mon Apr 09 22:11:48 2018 +0000
@@ -12,15 +12,15 @@
f = (sin(i) + 1.0) / 2 + 1; //1..2
i += 1;
if (i > 360) i = 0;
+ f * = val; // duty-cycle, perсents 0..1
}
int main() {
confSysClock();
- timer.attach(&sinus, 1);
+ timer.attach(&sinus, 1); //sine period, sec
Servo.period_ms(20);
sinus();
while(1) {
-
- Servo = (float)f * val; // duty-cycle, persents 0..1
+ Servo = (float)f;
}
}