Library to communicate with LDC1614
Dependents: Inductive_Sensor_3
Fork of LDC1101 by
Diff: LDC1614.cpp
- Revision:
- 31:ab4354a71996
- Parent:
- 30:95c53d244f91
- Child:
- 32:9712c9bdaf44
--- a/LDC1614.cpp Wed Aug 24 10:31:08 2016 +0000 +++ b/LDC1614.cpp Wed Sep 07 09:58:32 2016 +0000 @@ -10,7 +10,7 @@ * * @code * Serial pc(USBTX, USBRX); -* LDC1614 ldc(PTC6, PTC7, PTC5, 16E6, 2, 120E-12); +* LDC1614 ldc(PTC5, PTC4, PTC6, 16E6, 2, 120E-12); * int main(){ * while(1) { * while( !ldc.is_ready() ) {} @@ -25,7 +25,7 @@ #include "mbed_debug.h" -LDC1614::LDC1614(PinName sda, PinName scl, PinName sd, PinName os, float f_CLKIN, int channels, float capacitor) : _i2c(sda, scl), _shutdown_pin(sd), _oscillator(os) +LDC1614::LDC1614(PinName sda, PinName scl, PinName sd, float f_CLKIN, int channels, float capacitor) : _i2c(sda, scl), _shutdown_pin(sd) { // settings _channels = channels; // number of sensors @@ -116,11 +116,7 @@ { case LDC_MODE_ACTIVE: case LDC_MODE_SLEEP: - - // turn on oscillator - _oscillator.write( 1 ); - wait_ms(3); // datasheet oscillator says 3 ms max - + // turn on LDC _shutdown_pin.write( 0 ); set( CONFIG, SLEEP_MODE_EN, mode ); @@ -129,7 +125,6 @@ case LDC_MODE_SHUTDOWN: _shutdown_pin.write( 1 ); - _oscillator.write( 0 ); break; } }