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:
- 3:ca6028700d1a
- Parent:
- 2:3f9a695cde1c
- Child:
- 4:2196462a17f5
--- a/main.cpp Mon Apr 09 22:46:14 2018 +0000
+++ b/main.cpp Tue Apr 10 12:17:46 2018 +0000
@@ -6,10 +6,11 @@
Timeout timer;
-double f, i = 0;
+double f;
+int i = 0;
void sinus (){
- f = (sin(i) + 1.0) / 2 + 1; //1..2
+ f = (sin((double)i) + 1.0) / 2 + 1; //1..2
i += 1;
if (i > 360) i = 0;
Servo = (float)f * val; // duty-cycle, perсents 0..1;