Fa2018-es200-1112-proj2-rockemsockem
/
project2
Servo code
Diff: main.cpp
- Revision:
- 0:b00d475569de
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Oct 09 13:41:48 2018 +0000 @@ -0,0 +1,27 @@ +#include "mbed.h" +#include "Servo.h" +int main() { + Servo myservo1(p21); + Servo myservo2(p23); + + DigitalOut sw1(p20); + DigitalOut sw2(p19); + + while (1) { + + + myservo1.calibrate(0.0009, 90.0); + myservo2.calibrate(0.0009, 90.0); + + while (sw1 = 1) { + myservo1.write(0.0); + myservo1.write(2.0); + } + + while (sw2 = (1) ) { + myservo2.write(0.0); + myservo2.write(2.0); + } +} +} + \ No newline at end of file