Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
dancanada
Date:
Fri Jan 29 23:15:15 2010 +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	Fri Jan 29 23:15:15 2010 +0000
@@ -0,0 +1,62 @@
+#include "mbed.h"
+#include "USBMouse.h"
+
+DigitalOut led(LED1);
+USBMouse mouse;
+
+int main() {
+    Serial pc(USBTX, USBRX); // tx, rx
+    pc.printf("Hello serial comms!\n");
+
+//the "my mouse isn't working" spaz out
+            mouse.buttons(1,0,0);
+            mouse.buttons(0,0,0);
+       int x =1;    
+        while(x<=10){
+            led = !led;
+            mouse.buttons(1,0,0);
+            //move right
+            mouse.move(10, 0); 
+            mouse.buttons(0,0,0);
+            mouse.move(-9, 0); 
+            mouse.move(0,5);
+            x++;
+        }
+                
+ wait(0.8); //more than 0.5, less than 0.8
+             
+        x =1;    
+        while(x<=10){
+            led = !led;
+            mouse.buttons(0,1,0);
+            //move right
+            mouse.move(10, 0); 
+            mouse.buttons(0,0,0);
+            mouse.move(-9, 0); 
+            mouse.move(0,10);
+            x++;
+        }
+
+    pc.printf("mouse should have drawn 10 lines of mouse2 color, proably 3 of mouse1 color\n");
+
+}
+/*
+move around in a square shaped spiral
+x=1;
+        while(x<100){
+            led = !led;
+            //wait(0.01);     
+            //move right
+            mouse.move(10*x, 0);            
+            //move down
+            mouse.move(0, 10*x);
+            //increase count
+            x=x+1;       
+            //move left
+            mouse.move(-10*x, 0);            
+            //move up
+            mouse.move(0, -10*x);            
+            //increase count again
+            x=x+1;       
+        }
+        */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jan 29 23:15:15 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a0336ede94ce