Bob Giesberts / LDC1614

Dependencies:   SHTx

Dependents:   Inductive_Sensor_3

Fork of LDC1101 by Bob Giesberts

Revision:
9:6e2d808b113d
Parent:
8:b5fb9681869c
Child:
10:4fa62f8092c4
diff -r b5fb9681869c -r 6e2d808b113d LDC1000.cpp
--- a/LDC1000.cpp	Fri May 29 09:28:46 2015 +0000
+++ b/LDC1000.cpp	Fri May 29 11:25:13 2015 +0000
@@ -90,25 +90,17 @@
 };
 
 
-/* oude code terugzetten*/
-
+/* reads all 5 registers also after cable reconnect but het returns just one byte*/
 uint32_t LDC1000::readRawCounts(void)
 {
-    //union
-    //{
-    //    uint8_t buf[4];
-    //    uint32_t value;
-    //} val;
-    //val.value = 0;
     uint8_t val[5];
     readSPI(val,0x21,5);
-    return (uint32_t)(*(&val[2]));
+    unsigned int combinedbytes = (val[4]<<16)| (val[3]<<8) | val[2];  // combine the 3 bytes from registers 23, 24 and 25 
+    return combinedbytes;
+//    return (uint32_t)(*(&val[2]));
 }
 
 
-
-
-
  /*
 uint32_t LDC1000::readRawCounts(void)
 {