![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Boleh bisa langsung dicoba, tap servo base belum dikalibrasi
Diff: main.cpp
- Revision:
- 3:d1860dee0552
- Parent:
- 2:34ed8b55eba6
- Child:
- 4:3db9524b9b63
diff -r 34ed8b55eba6 -r d1860dee0552 main.cpp --- a/main.cpp Sat Apr 13 19:29:51 2019 +0000 +++ b/main.cpp Tue Apr 16 12:57:01 2019 +0000 @@ -8,8 +8,8 @@ 21 22 1 */ -Servo servo1(PA_7); -Servo servo2(PB_6); +Servo servo1(D9); +//Servo servo2(PB_6); Serial pc(D1, D0); int main() { @@ -17,16 +17,16 @@ pc.printf("test begin\n"); //tes - servo1.calibrate(0.001,150); - servo1.write(0); - servo2.write(1.0); + servo1.calibrate(0.0003,150); + //servo2.calibrate(0.001,150); + float f=0.8; + //servo2.write(1.0); while(1){ + servo1.write(f); pc.printf("input (1..10) bakal dijadiin persen : "); - float n=0.0; - pc.scanf("%f",&n); + pc.scanf("%f",&f); pc.printf("\n"); //float f = (float)n/(float)10; - servo1.write(f); pc.printf("%f", servo1.read()); pc.printf("\n"); }