
yo
Dependencies: MPU6050 Puck mbed
Fork of cube-puck by
Revision 4:6a2b306b6b41, committed 2014-07-25
- Comitter:
- sigveseb
- Date:
- Fri Jul 25 08:01:45 2014 +0000
- Parent:
- 3:6a7310ea51f7
- Child:
- 5:4c374f1f5df2
- Commit message:
- Update puck to use new puck lib
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Jul 24 14:28:09 2014 +0000 +++ b/main.cpp Fri Jul 25 08:01:45 2014 +0000 @@ -85,14 +85,13 @@ log_direction(direction); uint8_t directionAsInteger = direction; - puck->updateCharacteristicValue(DIRECTION_UUID, &directionAsInteger, 1); + int length = 1; + puck->updateCharacteristicValue(DIRECTION_UUID, &directionAsInteger, length); } int main() { - Ticker ticker; - ticker.attach(updateCubeDirection, 1); LOG_VERBOSE("MPU6050 test startup:\n"); @@ -105,13 +104,19 @@ LOG_ERROR("MPU not properly initialized!\n"); } + int characteristicValueLength = 1; puck->addCharacteristic( CUBE_SERVICE_UUID, DIRECTION_UUID, - 1, + characteristicValueLength, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY); puck->init(0xC0BE); + + + Ticker ticker; + ticker.attach(updateCubeDirection, 1); + LOG_INFO("Started listening to orientation changes.\n"); while(puck->drive()); } \ No newline at end of file