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:
- 30:3261015fdd17
- Parent:
- 28:42ae7eed0b68
- Child:
- 31:bf5f545621aa
diff -r 50be685a3f54 -r 3261015fdd17 DataGlove.cpp
--- a/DataGlove.cpp Thu Dec 11 05:26:39 2014 +0000
+++ b/DataGlove.cpp Thu Dec 11 05:57:54 2014 +0000
@@ -99,11 +99,11 @@
id = (Buf[4] << 8) + Buf[5];
pkgtype = Buf[3];
ReceiveCount++;
- if(ReceiveCount > 501 && ReceiveCount%25 == 0) {//printf("%d %c\r\n", ReceiveCount, Buf[0]);
+ /*if(ReceiveCount > 501 && ReceiveCount%25 == 0) {//printf("%d %c\r\n", ReceiveCount, Buf[0]);
printf("%f %f %f %f %f %f %f %f\r\n", corrected->roll, corrected->pitch, corrected->yaw,
corrected->fingers[0], corrected->fingers[1], corrected->fingers[2],
corrected->fingers[3], corrected->fingers[4]);
- }
+ }*/
switch (pkgtype){
case STREAM_FINGERS_QUATERNION:
{
@@ -160,17 +160,17 @@
corrected->fingers[iter] = gl->fingers[iter] - correction->fingers[iter];
}*/
}
- else {
+ else {
//printf("couldn't get data %d\r\n", notConnectedCount);
// Re-establishing communication in case no data is received for 1s (20 frames per second*1 = 20)
- if (notConnectedCount > 200) {
+ /*if (notConnectedCount > 200) {
printf("Connection broke! Trying to re-establish... %d %c\r\n",numReceived,Buf[0]);
//GloveSocket.Reconnect();
//StreamData(STREAM_QUATERNION);
notConnectedCount = 0;
- }
+ }*/
numReceived = 0;
- notConnectedCount++;
+ //notConnectedCount++;
}
return false;
}
