Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Inductive_Sensor_3
Fork of LDC1101 by
Diff: LDC1000.cpp
- Revision:
- 9:6e2d808b113d
- Parent:
- 8:b5fb9681869c
- Child:
- 10:4fa62f8092c4
--- 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)
{
