This is the DW1000 driver and our self developed distance measurement application based on it. We do this as a semester thesis at ETH Zürich under the Automatic Control Laboratory in the Department of electrical engineering.

Dependencies:   mbed

Revision:
31:6f76f3d518ac
Parent:
30:4ecc69d3cf8d
Child:
32:041dd02e0e3b
--- a/main.cpp	Fri Nov 28 17:06:51 2014 +0000
+++ b/main.cpp	Mon Dec 01 13:04:18 2014 +0000
@@ -17,17 +17,25 @@
     pc.printf("EUI register: %016llX\r\n", dw.getEUI());
     pc.printf("Voltage: %f\r\n", dw.getVoltage());
 
-    //r.receiver = true;
-    
+    r.receiver = true;
+    bool senderstart = true;
     while(1) {
         for(int j = 0; j < 10; j++)
+            pc.printf("%f ", r.tofs[j]*MMRANGING_TIMEUNIT);
+        pc.printf("\r\n");
+        for(int j = 0; j < 10; j++)
             if(r.event[j][0] == '!') {
                 pc.printf("%s Time: %fus\r\n", r.event[j], r.eventtimes[j]*MMRANGING_TIMEUNIT);
                 r.event[j][0] = 'X';
             }    
         if (!r.receiver) {
-                r.requestRanging();
-                wait(1);
+                if(senderstart)
+                    r.requestRanging();
+                else
+                    r.requestTime();
+                senderstart = !senderstart;
         }
+        pc.printf("Status: %llX\r\n", dw.getStatus());
+        wait(2);
     }
 }
\ No newline at end of file