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
Diff: main.cpp
- Revision:
- 7:4244572015c6
- Parent:
- 6:4f2aaa06ff44
- Child:
- 10:3d708495b7a0
--- 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);