You can use your FRDM-K64F device as a joypad.

Dependencies:   FXOS8700Q mbed

Check my repo for a compatible game using K64F. Currently works on Max OSX, can be implemented on Linux by changing Serial Port configuration.

Files at this revision

API Documentation at this revision

Comitter:
co838_gtvl2
Date:
Wed Feb 24 19:55:15 2016 +0000
Child:
1:cb4a1b11de74
Commit message:
If poked via Serial, it displays the current state of the accelerometer.; Uses sleep and interrupt to save energy.

Changed in this revision

FXOS8700Q.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FXOS8700Q.lib	Wed Feb 24 19:55:15 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/JimCarver/code/FXOS8700Q/#5553a64d0762
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Feb 24 19:55:15 2016 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+#include "FXOS8700Q.h"
+
+Serial          pc(USBTX, USBRX);
+FXOS8700Q_acc   accel(PTE25, PTE24, FXOS8700CQ_SLAVE_ADDR1);
+
+void pc_interrupt(void)
+{
+    pc.getc();
+    wait(.01);
+    int16_t accX, accY, accZ;
+    accel.getX(&accX);
+    accel.getY(&accY);
+    accel.getZ(&accZ);
+    pc.printf("%d;%d;%d\r\n", accX, accY, accZ);
+}
+
+int main(void)
+{
+    pc.baud(38400);
+    pc.attach(&pc_interrupt);
+    
+    accel.enable();
+    while (true) {
+        sleep();
+    }
+    accel.disable();   
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Feb 24 19:55:15 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/252557024ec3
\ No newline at end of file