Send on Sync message

Dependencies:   BNO055_fusion RF24_fork mbed

Fork of F042_BNO055_toNRF24 by BME SmartLab

Files at this revision

API Documentation at this revision

Comitter:
mrcrsch
Date:
Mon Feb 06 21:20:55 2017 +0000
Parent:
2:80989e6af5e7
Commit message:
working version with sync messages. mbed-dev lib needed without stdio and serial

Changed in this revision

config.h 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 80989e6af5e7 -r 6bba74b99bd3 config.h
--- a/config.h	Thu Jan 26 12:09:18 2017 +0000
+++ b/config.h	Mon Feb 06 21:20:55 2017 +0000
@@ -5,7 +5,7 @@
 
 //This header contains calibration data
 
-#define NodeID 6
+#define NodeID 7
 #define RadioChannel 90
 #define SendDelay 3 //ms
 
diff -r 80989e6af5e7 -r 6bba74b99bd3 main.cpp
--- a/main.cpp	Thu Jan 26 12:09:18 2017 +0000
+++ b/main.cpp	Mon Feb 06 21:20:55 2017 +0000
@@ -3,9 +3,8 @@
 #include "RF24.h"
 #include "config.h"
 
-#ifdef DEVICE_SERIAL
-#undef DEVICE_SERIAL
-#endif
+#define uniqueSerialAddr_stm32 (unsigned long *)0x1FFFF7E8 
+#define STM32_UUID ((uint32_t *)0x40048058)
 
 DigitalOut led(ledpin);
 I2C i2c(i2c_sda, i2c_scl);
@@ -22,7 +21,6 @@
     uint8_t packageCntr;
     int16_t q[4];
     int32_t linAcc[3];
-
 } imuData;
 
 struct SyncMsg {
@@ -51,8 +49,6 @@
 bool SendFlag = false;
 
 
-Timer SendTimer;
-
 
 int main()
 {
@@ -73,6 +69,10 @@
 
 
     SetupRadio();
+    
+    uint32_t idPart1 = STM32_UUID[0];
+    uint32_t idPart2 = STM32_UUID[1];
+    uint32_t idPart3 = STM32_UUID[2];
     //radio setup
 
 
@@ -81,7 +81,7 @@
 
 
 
-    imuData.sensorID = NodeID;
+    imuData.sensorID = idPart2;
     imuData.packageCntr = 0;
 
     while(true) {