![](/media/cache/profiles/909f269e0b3ffbd61d906f9b25eecaf6.jpg.50x50_q85.jpg)
a hack to use buttons to fake a cube puck
Dependencies: MPU6050 Puck mbed
Fork of cube-puck by
Diff: main.cpp
- Revision:
- 7:4f2aaa06ff44
- Parent:
- 4:6a2b306b6b41
- Child:
- 8:4244572015c6
--- a/main.cpp Fri Jul 25 09:08:11 2014 +0000 +++ b/main.cpp Tue Aug 05 08:53:18 2014 +0000 @@ -1,7 +1,22 @@ +/** + * Copyright 2014 Nordic Semiconductor + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + #include "MPU6050.h" #include <math.h> -#define LOG_LEVEL_INFO #include "Puck.h" Puck* puck = &Puck::getPuck(); @@ -111,11 +126,11 @@ characteristicValueLength, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY); - puck->init(0xC0BE); + puck->init(0xC1BE); Ticker ticker; - ticker.attach(updateCubeDirection, 1); + ticker.attach(updateCubeDirection, 0.2); LOG_INFO("Started listening to orientation changes.\n"); while(puck->drive());