Tobi's ubw test branch

Dependencies:   mavlink_bridge mbed

Fork of AIT_UWB_Range by Benjamin Hepp

Revision:
16:96879e1c99f2
Parent:
15:e1fea7e2aff1
Child:
17:8afa5f9122da
diff -r e1fea7e2aff1 -r 96879e1c99f2 main.cpp
--- a/main.cpp	Sun Nov 23 20:45:14 2014 +0000
+++ b/main.cpp	Mon Nov 24 12:48:40 2014 +0000
@@ -24,9 +24,12 @@
     framelength &= 0x03FF;
     framelength -= 2;
     
-    char* receive = dw.receiveString();                             // receive a string
-    pc.printf("Received: \"%s\" %d ", receive, framelength);
-    delete[] receive;
+    if(framelength<200) {
+        char* receive = dw.receiveString();                             // receive a string
+        pc.printf("Received: \"%s\" %d ", receive, framelength);
+        delete[] receive;
+    } else
+        pc.printf("Received! %d ", framelength);
     
 # ifdef PINGPONG
     uint64_t status;
@@ -85,13 +88,14 @@
         message[i+1] = '\0';
 
         pc.printf("%d Message: \"%s\" %d\r\n", i, message, strlen(message)+1);
-        wait(0.1);
+        
+        //wait(0.1);
         char messagecheck[1024];
         dw.sendString(message);
         wait(0.1);
         dw.readRegister(DW1000_TX_BUFFER, 0, (uint8_t*)messagecheck, strlen(message)+1);
         pc.printf("%d nBuffer: \"%s\" %d\r\n\r\n", i, messagecheck, strlen(messagecheck)+1);
-        wait(0.2);
+        //wait(0.1);
         
         //return 0;
         /*for(int i=0; i<10; i++) {                                 // to control Voltage