First commit at here
Dependencies: mbed Servo Motornew
main.cpp
- Committer:
- harrymunli
- Date:
- 2019-04-13
- Revision:
- 2:34ed8b55eba6
- Parent:
- 1:9284c57e84da
- Child:
- 3:d1860dee0552
File content as of revision 2:34ed8b55eba6:
#include "mbed.h" #include "Servo.h" #include "Motor.h" /* Nama servo 4 3 21 22 1 */ Servo servo1(PA_7); Servo servo2(PB_6); Serial pc(D1, D0); int main() { pc.baud(9600); pc.printf("test begin\n"); //tes servo1.calibrate(0.001,150); servo1.write(0); servo2.write(1.0); while(1){ pc.printf("input (1..10) bakal dijadiin persen : "); float n=0.0; pc.scanf("%f",&n); pc.printf("\n"); //float f = (float)n/(float)10; servo1.write(f); pc.printf("%f", servo1.read()); pc.printf("\n"); } }