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: MMA8451Q Multi_WS2811 NVIC_set_all_priorities TSI cc3000_hostdriver_mbedsocket mbed
Fork of CubicHand by
Diff: DataGlove.cpp
- Revision:
- 23:a8de4f87cada
- Parent:
- 22:0cc5b7e55419
- Child:
- 28:42ae7eed0b68
--- a/DataGlove.cpp Thu Dec 11 04:07:54 2014 +0000
+++ b/DataGlove.cpp Thu Dec 11 04:17:46 2014 +0000
@@ -14,6 +14,7 @@
corrected = new Glove;
ReceiveCount = 0;
numReceived = 0;
+ NewData = false;
//Initialize correction values to 0
correction->roll = 0.0;
correction->pitch = 0.0;
@@ -123,6 +124,7 @@
}
break;
}
+ NewData = true;
Buf[0] = 0; //Clear Token so no repeats.
notConnectedCount = 0;
numReceived = 0;
@@ -311,4 +313,20 @@
gl->pitch = 0.0;
gl->yaw = 0.0;
gl->lastPkgTime = timeOfArrival;
+}
+
+Glove DataGlove::GetCurrentValues()
+{
+ return *gl;
+}
+bool DataGlove::CheckForNewValues()
+{
+ if(NewData == true)
+ {
+ NewData = false;
+ return true;
+ }else
+ {
+ return false;
+ }
}
\ No newline at end of file
