First commit at here

Dependencies:   mbed Servo Motornew

Files at this revision

API Documentation at this revision

Comitter:
D4n1elR
Date:
Sun May 12 16:00:19 2019 +0000
Parent:
5:832f5a808578
Commit message:
Memecahkan masalah input 2 kali (input cuma jadi sekali)

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 832f5a808578 -r 38fb058f5827 main.cpp
--- a/main.cpp	Sun May 12 14:18:11 2019 +0000
+++ b/main.cpp	Sun May 12 16:00:19 2019 +0000
@@ -22,14 +22,16 @@
     float f=0;
     //servo2.write(1.0);
     while(1){
-        servo1.position((f+51)*1.10);
+        servo1.position((f-51)*1.14);
         //servo1.pulsewidth_ms(f);    //pc.printf("input (1..10) bakal dijadiin persen : ");
         pc.printf("input (1..360) bakal dijadiin derajat : ");
-        pc.scanf("%f\n",&f);
+        pc.scanf("%f",&f);
+        
         //pc.printf("\n");
 //        float f = (float)n/(float)10;
-        pc.printf("%f\n",&f);
-        //pc.printf("\n");
+        wait_ms(20);
+        pc.printf("%f\n",servo1.read());
+        //pc.printf(" \n");
         
     }
 }