Bob Giesberts / LDC1614

Dependencies:   SHTx

Dependents:   Inductive_Sensor_3

Fork of LDC1101 by Bob Giesberts

Revision:
4:62ebb87678f8
Parent:
2:44b76f6f19d5
Child:
5:98d4fd07734a
--- a/LDC1000.cpp	Tue May 19 13:31:03 2015 +0000
+++ b/LDC1000.cpp	Tue May 19 14:10:01 2015 +0000
@@ -11,7 +11,7 @@
 
 #include "LDC1000.h"
 
-LDC1000::LDC1000(PinName mosi, PinName miso, PinName sck, PinName cs, float capacitor, float f_external, PinName clock_out) : _spiport(mosi,miso,sck,NC), _cs_pin(cs), _clock(clock_out)
+LDC1000::LDC1000(PinName mosi, PinName miso, PinName sck, PinName cs, float capacitor, float f_external, PinName clock_out) : _spiport(mosi,miso,sck,NC), _cs_pin(cs), _clock(clock_out,1)
 {
     cap = capacitor;
     _spiport.format(8,3);
@@ -57,8 +57,8 @@
 void LDC1000::setFrequency(float frequency)
 {
     _frequency = frequency;
-    _clock.write(0.5);
     _clock.period(1.0/frequency);
+    _clock.pulsewidth(0.5/frequency);
 }
 
 float LDC1000::getInductance()