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: gatt_service.cpp
- Revision:
- 0:449ee9595cf6
- Child:
- 2:b9b42ff80e9a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gatt_service.cpp Thu Jul 03 11:25:12 2014 +0000 @@ -0,0 +1,22 @@ +#include "BLEDevice.h" + +uint8_t uuid_array_service[16] = {'b', 'f', 't', 'j', ' ', 'c', 'u', 'b', 'e', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }; +uint8_t uuid_array_direction[16] = {'b', 'f', 't', 'j', ' ', 'c', 'u', 'b', 'e', ' ', 'd', 'i', 'r', 'c', 't', 'n' }; + +const UUID uuid_service = UUID(uuid_array_service); +const UUID uuid_direction = UUID(uuid_array_direction); + +uint8_t direction_data[1] = {6}; + +GattCharacteristic directionCharacteristic( + uuid_direction, + direction_data, + sizeof(direction_data), + sizeof(direction_data), + GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ); + +GattCharacteristic *characteristics[] = {&directionCharacteristic}; +GattService cube_service(uuid_service, + characteristics, + sizeof(characteristics) / sizeof(GattCharacteristic *)); +