эээм

Dependencies:   mbed-STM32F103C8T6 mbed

Files at this revision

API Documentation at this revision

Comitter:
RuslanUrya
Date:
Sat Apr 07 12:27:25 2018 +0000
Parent:
0:2d3da2f0f265
Commit message:
-90. 0. 90

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sat Apr 07 08:18:51 2018 +0000
+++ b/main.cpp	Sat Apr 07 12:27:25 2018 +0000
@@ -1,20 +1,19 @@
 #include "mbed.h"
 #include "stm32f103c8t6.h"
-#define position (100 / 20)
+#define position 0.05
 
-PwmOut Servo(PB_6);
+PwmOut Servo(PA_8);
 
 int main() {
     confSysClock();
     Servo.period_ms(20);
     
     while(1) {
-        Servo = position * 1.5;
-        wait(1000);
-        Servo = position * 1.0;
-        wait(1000);
-        Servo = position * 2.0;
-        wait(1000);
-        
+        Servo = position * 0.545; // max right
+        wait_ms(1000);
+        Servo = position * 1.5;  //center
+        wait_ms(1000);
+        Servo = position * 2.6;  //max left
+        wait_ms(1000);
     }
 }