Benson Sin
/
Servo
Servo for mbed
Diff: main.cpp
- Revision:
- 0:7be84d2bee6e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Mar 04 07:43:26 2021 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "Servo.h" + +DigitalIn button(USER_BUTTON); + +DigitalOut myled(LED1); +DigitalOut voltage(PB_2); + +Servo servo(D6); + +int main() { + myled = 0; + + while(1) { + if(button == 0) { + myled = 1; + servo = 1.0; + } + else { + myled = 0; + servo = 0; + } + } +} \ No newline at end of file