Dependencies:   ServoOut mbed

Files at this revision

API Documentation at this revision

Comitter:
chuckwebb
Date:
Fri Dec 16 19:08:43 2016 +0000
Commit message:

Changed in this revision

ServoOut.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
diff -r 000000000000 -r b87696259aa1 ServoOut.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ServoOut.lib	Fri Dec 16 19:08:43 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/jebradshaw/code/ServoOut/#6a59017c4f62
diff -r 000000000000 -r b87696259aa1 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Dec 16 19:08:43 2016 +0000
@@ -0,0 +1,34 @@
+#include "mbed.h"
+#include "ServoOut.h"
+
+DigitalOut myled(LED1);
+
+Serial pc(USBTX, USBRX);
+
+ServoOut servo1(p15);
+ServoOut servo2(p16);
+ServoOut servo3(p17);
+
+int main() {
+    char rx_str[100];
+    float PW;
+    
+    while(1) {
+        
+        if(pc.readable())
+        {  
+            pc.scanf("%f*",&PW);
+            
+            pc.printf("Commanded pulse width: %f [microsec]\n",PW);
+        }
+        
+        servo1.pulse_us = PW;
+        servo2.pulse_us = PW;        
+        servo3.pulse_us = PW; 
+        
+        myled = 1;
+        wait(1);
+        myled = 0;
+        wait(1);
+    }
+}
diff -r 000000000000 -r b87696259aa1 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Dec 16 19:08:43 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/0ab6a29f35bf
\ No newline at end of file