Dependencies:   mbed Servo

Files at this revision

API Documentation at this revision

Comitter:
gbeardall
Date:
Mon Oct 17 10:42:30 2011 +0000
Commit message:

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
diff -r 000000000000 -r c055a2cae8b6 Servo.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Mon Oct 17 10:42:30 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/cr0n0s20/code/Servo/#5490c22f727d
diff -r 000000000000 -r c055a2cae8b6 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Oct 17 10:42:30 2011 +0000
@@ -0,0 +1,54 @@
+/*
+ * servo1: main.cpp - test program
+ *
+ */
+
+#include <assert.h>
+
+#include "mbed.h"
+#include "Servo.h"
+
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+DigitalOut led4(LED4);
+
+Serial pc(USBTX,USBRX);
+
+Servo servo(p21);
+
+// ---------------------------------------------------------------------------
+
+int main() {
+
+    pc.printf("\n\rStart: servo1\n\r");
+
+    // sweep servo
+    for(int i=0; i<1; ++i) {
+    
+    for( float p=0; p<=1.0; p+=0.01) {
+        servo = p;
+        wait(0.01);
+    } // for 
+    
+    for( float p=1.0; p>=0; p-=0.01) {
+        servo = p;
+        wait(0.01);
+    } // for 
+    
+    } // for - i
+
+    fprintf(stdout, "stdout1\n\r");
+    fprintf(stderr, "stderr1\n\r");
+
+    assert(1); // if false; just exits (no msg to stderr)
+    
+    fprintf(stdout, "stdout2\n\r");
+    fprintf(stderr, "stderr2\n\r");
+
+    exit(0);
+
+} // main
+
+// ---------------------------------------------------------------------------
+
diff -r 000000000000 -r c055a2cae8b6 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Oct 17 10:42:30 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912