эээм

Dependencies:   mbed-STM32F103C8T6 mbed

Revision:
1:c86ffbbf8803
Parent:
0:2d3da2f0f265
--- 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);
     }
 }