Fa2018-es200-1112-proj2-rockemsockem
/
project2
Servo code
Revision 0:b00d475569de, committed 2018-10-09
- Comitter:
- lugi_dugi
- Date:
- Tue Oct 09 13:41:48 2018 +0000
- Commit message:
- Code for servo;
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Servo.lib Tue Oct 09 13:41:48 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/simon/code/Servo/#36b69a7ced07
--- /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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Oct 09 13:41:48 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187 \ No newline at end of file