k

Dependencies:   C12832 mbed

Fork of DecaWave by Matthias Grob & Manuel Stalder

Files at this revision

API Documentation at this revision

Comitter:
Kekehoho
Date:
Fri Aug 19 17:40:09 2016 +0000
Parent:
47:b6120c152ad1
Commit message:
j

Changed in this revision

C12832.lib Show annotated file Show diff for this revision Revisions of this file
DW1000/DW1000.cpp Show annotated file Show diff for this revision Revisions of this file
MM2WayRanging/MM2WayRanging.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r b6120c152ad1 -r bf6c54dc69b3 C12832.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C12832.lib	Fri Aug 19 17:40:09 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/mpetovello/code/C12832/#878d97d7c263
diff -r b6120c152ad1 -r bf6c54dc69b3 DW1000/DW1000.cpp
--- a/DW1000/DW1000.cpp	Thu Mar 19 12:54:28 2015 +0000
+++ b/DW1000/DW1000.cpp	Fri Aug 19 17:40:09 2016 +0000
@@ -262,7 +262,8 @@
     if (subaddress > 0) {                                                       // there's a subadress, we need to set flag and send second header byte
         spi.write(reg | DW1000_SUBADDRESS_FLAG);
         if (subaddress > 0x7F) {                                                // sub address too long, we need to set flag and send third header byte
-            spi.write((uint8_t)(subaddress & 0x7F) | DW1000_2_SUBADDRESS_FLAG); // and 
+            spi.write((uint8_t)(subaddress & 0x7F)
+             | DW1000_2_SUBADDRESS_FLAG); // and 
             spi.write((uint8_t)(subaddress >> 7));
         } else {
             spi.write((uint8_t)subaddress);
diff -r b6120c152ad1 -r bf6c54dc69b3 MM2WayRanging/MM2WayRanging.cpp
--- a/MM2WayRanging/MM2WayRanging.cpp	Thu Mar 19 12:54:28 2015 +0000
+++ b/MM2WayRanging/MM2WayRanging.cpp	Fri Aug 19 17:40:09 2016 +0000
@@ -3,7 +3,7 @@
 MM2WayRanging::MM2WayRanging(DW1000& DW) : dw(DW) {
     isAnchor = true;
     overflow = false;
-    address = 0;
+    address = 2;
     rxTimestamp = 0;
     timediffRec = 0;
     timediffSend = 0;
diff -r b6120c152ad1 -r bf6c54dc69b3 main.cpp
--- a/main.cpp	Thu Mar 19 12:54:28 2015 +0000
+++ b/main.cpp	Fri Aug 19 17:40:09 2016 +0000
@@ -3,11 +3,13 @@
 #include "PC.h"                                     // Serial Port via USB for debugging with Terminal
 #include "DW1000.h"                                 // our DW1000 device driver
 #include "MM2WayRanging.h"                          // our self developed ranging application
+//#include "C12832.h"
 
 #define myprintf    pc.printf                       // to make the code adaptable to other outputs that support printf
 
-PC              pc(USBTX, USBRX, 921600);           // USB UART Terminal
-DW1000          dw(PA_7, PA_6, PA_5, PB_6, PB_9);   // Device driver instanceSPI pins: (MOSI, MISO, SCLK, CS, IRQ)
+Serial          pc(USBTX, USBRX);           // USB UART Terminal
+//C12832          lcd(p5, p7, p6, p8, p11);
+DW1000          dw(p5, p6, p7, p11, p15);   // Device driver instanceSPI pins: (MOSI, MISO, SCLK, CS, IRQ)
 MM2WayRanging   node(dw);                           // Instance of the two way ranging algorithm
 
 void rangeAndDisplayAll(){
@@ -42,7 +44,7 @@
 
         if (node.distances[destination] == -1) {
             myprintf("Measurement timed out\r\n");
-            wait(0.001);
+            wait(0.1);
             continue;
         }
 
@@ -98,7 +100,7 @@
     node.isAnchor = true;                       // declare as anchor or beacon
     
     if (node.isAnchor) {
-        node.address = 1;
+        node.address = 4;
         myprintf("This node is Anchor node %d \r\n", node.address);
     } else {
         node.address = 0;
@@ -113,7 +115,6 @@
         if (!node.isAnchor){
             rangeAndDisplayAll();
             //calibrationRanging(4);
-        
         } else {
             //myprintf("."); // to see if the core and output is working
             wait(0.5);