Rotate the Cube Puck to invoke actions on your smartphone. Built on the Puck IOT platform.

Dependencies:   Puck MPU6050 mbed

The Cube Puck is an innovative bluetooth-enabled remote control device. It is a six-sided cube that can be rotated to any of its sides to invoke actions linked to that side. The cube puck is completely customizable and therefore also quite versatile.

A tutorial for the Cube Puck is available on GitHub.

Tutorials and in-depth documentation for the Puck platform is available at the project's GitHub page

Files at this revision

API Documentation at this revision

Comitter:
sigveseb
Date:
Fri Aug 08 12:47:20 2014 +0000
Parent:
6:4f2aaa06ff44
Child:
8:9125497a376f
Commit message:
Add MPU6050 failure recovery

Changed in this revision

MPU6050.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/MPU6050.lib	Tue Aug 05 08:53:18 2014 +0000
+++ b/MPU6050.lib	Fri Aug 08 12:47:20 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/Nordic-Pucks/code/MPU6050/#8162a54451b5
+http://mbed.org/teams/Nordic-Pucks/code/MPU6050/#597a90170e5c
--- a/main.cpp	Tue Aug 05 08:53:18 2014 +0000
+++ b/main.cpp	Fri Aug 08 12:47:20 2014 +0000
@@ -66,6 +66,15 @@
 }
 
 void updateCubeDirection(void) {
+    
+    if(!mpu.testConnection()) {
+        LOG_ERROR("MPU DIED! Resetting...\n");
+        mpu.reset();
+        mpu.initialize();
+        LOG_ERROR("Reset complete.\n");
+        return;
+    }
+    
     mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
 
     int16_t x = direction_if_exited(ax);