Temp Fork
Dependencies: MMA8451Q Multi_WS2811 NVIC_set_all_priorities TSI cc3000_hostdriver_mbedsocket mbed
Fork of CubicHand by
Revision 30:3261015fdd17, committed 2014-12-11
- Comitter:
- kalbers
- Date:
- Thu Dec 11 05:57:54 2014 +0000
- Parent:
- 29:50be685a3f54
- Child:
- 31:bf5f545621aa
- Commit message:
- Removed Print Statements from main while loop program.
Changed in this revision
--- 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;
}
--- a/GloveWifi.cpp Thu Dec 11 05:26:39 2014 +0000
+++ b/GloveWifi.cpp Thu Dec 11 05:57:54 2014 +0000
@@ -84,7 +84,7 @@
wait(1);
}
socket->set_blocking(false, 10);
- printf("Reconnected!\r\n");
+ //printf("Reconnected!\r\n");
}
int GloveWifi::GetDataFromBuffer(char * buf, int size)
@@ -99,7 +99,7 @@
{
DropCount = 0;
}
- if(DropCount > 20)
+ if(DropCount > 100)
{
Reconnect();
DropCount = 0;
--- a/main.cpp Thu Dec 11 05:26:39 2014 +0000
+++ b/main.cpp Thu Dec 11 05:57:54 2014 +0000
@@ -9,6 +9,9 @@
int main()
{
+ long Counter = 0;
+ DigitalOut StatusLED(LED1);
+ StatusLED = 0;
Serial pc(USBTX, USBRX);
pc.baud(115200);
pc.printf("Connceted to PC \r\n");
@@ -16,8 +19,12 @@
pc.printf("DataGlove Cube Client\r\n");
while(true)
{
- MasterGlove.Receive();
+ MasterGlove.ReceiveBlocking();
//pc.printf("Looping \r\n");
//wait(0.1);
+ if(Counter++%25 == 0)
+ {
+ StatusLED = !StatusLED;
+ }
}
}
