FRDM-K64 USB air mouse demo

Dependencies:   FXOS8700Q USBDevice mbed

Files at this revision

API Documentation at this revision

Comitter:
APanecatl
Date:
Wed Jul 09 19:33:09 2014 +0000
Commit message:
rev 1.0

Changed in this revision

FXOS8700Q.lib Show annotated file Show diff for this revision Revisions of this file
USBDevice.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 d50fb46005fd FXOS8700Q.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FXOS8700Q.lib	Wed Jul 09 19:33:09 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/JimCarver/code/FXOS8700Q/#5553a64d0762
diff -r 000000000000 -r d50fb46005fd USBDevice.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USBDevice.lib	Wed Jul 09 19:33:09 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/USBDevice/#0c6524151939
diff -r 000000000000 -r d50fb46005fd main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jul 09 19:33:09 2014 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+#include "USBMouse.h"
+#include "FXOS8700Q.h"
+
+//I2C lines for FXOS8700Q accelerometer/magnetometer
+FXOS8700Q_acc acc( PTE25, PTE24, FXOS8700CQ_SLAVE_ADDR1);
+
+USBMouse mouse;
+ 
+int main() 
+{
+    acc.enable();
+    float faX, faY, faZ;
+    int16_t x = 0;
+    int16_t y = 0;
+    
+    while (1) 
+    {
+        //acc.getAxis(acc_data);
+        acc.getX(&faX);
+        acc.getY(&faY);
+        x = 10*faX;
+        y = 10*faY;
+        
+        mouse.move(x, y);
+        wait(0.001);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r d50fb46005fd mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jul 09 19:33:09 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/024bf7f99721
\ No newline at end of file