Steven Rhodes / Mbed 2 deprecated CNCAirbrushCode

Files at this revision

API Documentation at this revision

Comitter:
stvnrhodes
Date:
Sat Apr 21 02:21:31 2012 +0000
Parent:
2:d3a99fd96468
Commit message:
For Adam

Changed in this revision

CNCAirbrush.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
--- a/CNCAirbrush.lib	Thu Apr 19 22:26:00 2012 +0000
+++ b/CNCAirbrush.lib	Sat Apr 21 02:21:31 2012 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/stvnrhodes/code/CNCAirbrush/#328a79795feb
+http://mbed.org/users/stvnrhodes/code/CNCAirbrush/#09363cae1b53
--- a/main.cpp	Thu Apr 19 22:26:00 2012 +0000
+++ b/main.cpp	Sat Apr 21 02:21:31 2012 +0000
@@ -14,7 +14,7 @@
     pc.baud(460800);
     printf("Test Airbrush!\r\n");
     wifi.createAdhocNetwork();
-    bmp.openImg("/local/a.bmp");
+   /* bmp.openImg("/local/a.bmp");
     for (int i=0; i < bmp.getHeight(); i++) {
         pc.printf("Row %3d: ", i);
         bmp.setRow(i);
@@ -27,7 +27,7 @@
         }
         pc.printf("\n\r");
     }
-    bmp.closeImg();
+    bmp.closeImg();*/
     while (1) {
         while(pc.readable()) {
             wifi.putc(pc.getc());
@@ -40,13 +40,18 @@
             switch(cmd->cmd) {
               case 0x00:
                 pc.printf("Move to x: %d, y:%d, z:%d\n\r", cmd->l[0], cmd->l[1], cmd->l[2]);
-                wait(3);
-                wifi.send("Done"); // Make sure to always send confirmation
+                wait(2);
                 break;
               default:
                 pc.printf("You should probably do something with case %x\n\r", cmd->cmd);
-                wifi.send("No code");
             }
+            cmd->cmd = 8;
+            cmd->l[0] = 100;
+            cmd->l[1] = 300;
+            cmd->l[2] = 0;
+            cmd->f[3] = 0.5;
+            cmd->f[4] = 0.0;
+            wifi.sendCmd(cmd);
         }
     }
 }