Robot code

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
ikhorosh
Date:
Thu Oct 13 03:06:59 2011 +0000
Commit message:

Changed in this revision

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/main.cpp	Thu Oct 13 03:06:59 2011 +0000
@@ -0,0 +1,34 @@
+#include "mbed.h"
+
+Serial xbee1(p9, p10);
+DigitalOut rst1(p11);
+
+DigitalOut rev(p22);
+DigitalOut fwd(p20);
+DigitalOut Led1(LED1);
+DigitalOut Led2(LED2);
+
+PwmOut pwmout(p21);
+
+Serial pc(USBTX, USBRX);
+
+int main() {
+
+    rst1 = 0;   //Set reset pin to 0
+    wait(.5);
+    rst1 = 1;   //Set reset pin to 1
+    int X = 0;
+    wait(.5);
+    pc.printf("starting rec");
+    rev = 1;
+    fwd = 0;
+    char b = 'c';
+    while(1) {
+        if(xbee1.readable()) {
+            char X = xbee1.getc(); //XBee read
+            wait(.25);
+            pc.printf("b = %f", X/100.0);
+            pwmout = X/100.0;
+    }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 13 03:06:59 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912