Servo for mbed

Dependencies:   mbed Servo

Files at this revision

API Documentation at this revision

Comitter:
bensonsinsin998
Date:
Thu Mar 04 07:43:26 2021 +0000
Commit message:
Servo;

Changed in this revision

Servo.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Thu Mar 04 07:43:26 2021 +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	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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Mar 04 07:43:26 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file