EtherCAT slave that reads 3 Xsens IMU's connected to a Xbus Master

Dependencies:   MODSERIAL mbed KL25Z_ClockControl

Fork of EtherCAT by First Last

Revision:
5:6d75f432a41f
Parent:
4:bb72df6dce33
Child:
8:09dcef3ed467
--- a/EtherCAT/cpuinit.cpp	Thu Dec 11 22:31:10 2014 +0000
+++ b/EtherCAT/cpuinit.cpp	Thu Dec 11 23:12:11 2014 +0000
@@ -32,6 +32,11 @@
 #include "cpuinit.h"
 #include "mbed.h"
 
+extern float FrontRight_offset;
+extern float FrontLeft_offset;
+extern float BackLeft_offset;
+extern float BackRight_offset;
+
 void cpuinit(void)
 {
     //shoe_serial.baud(921600);
@@ -52,6 +57,12 @@
     DigitalOut dummy12(PTE30);
     dummy1 = dummy2 = dummy3 = dummy4 = dummy5 = dummy6 = 0;
     dummy7 = dummy8 = dummy9 = dummy10 = dummy11 = dummy12 = 0;
+    //offset correction
+    wait_ms(20);
+    FrontLeft_offset = adcFrontLeft;
+    FrontRight_offset = adcFrontRight;
+    BackLeft_offset = adcBackLeft;
+    BackRight_offset = adcBackRight;
 
 }