Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 4DGL-uLCD-SE LSM9DS1_Library SDFileSystem mbed-rtos mbed wave_player
Diff: InputHandler.cpp
- Revision:
- 1:61b8141da36e
- Parent:
- 0:6a49493943be
diff -r 6a49493943be -r 61b8141da36e InputHandler.cpp
--- a/InputHandler.cpp Thu Mar 10 20:10:35 2016 +0000
+++ b/InputHandler.cpp Thu Mar 10 22:28:51 2016 +0000
@@ -3,16 +3,15 @@
#define START_THREAD 1
InputHandler::InputHandler(PinName sda, PinName scl, uint8_t xgAddr, uint8_t mAddr, PinName digitalIn)
- :thread(&InputHandler::threadStarter, this, osPriorityNormal,1024),
- imu(sda, scl, xgAddr, mAddr),
+ :imu(sda, scl, xgAddr, mAddr),
pushButton(digitalIn, PullUp)
{
imu.begin();
-// imu.calibrate(1);
+ imu.calibrate(1);
}
void InputHandler::start() {
- thread.signal_set(START_THREAD);
+ Thread thread(&InputHandler::threadStarter, this, osPriorityNormal,1024);
}
float InputHandler::getXAccel() {
@@ -49,8 +48,6 @@
}
void InputHandler::retrieveInputs() {
- thread.signal_wait(START_THREAD);
-
while(true) {
imu.readAccel();