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:
- 4:62ebb87678f8
- Parent:
- 2:44b76f6f19d5
- Child:
- 5:98d4fd07734a
diff -r bf6ac5967bd1 -r 62ebb87678f8 LDC1000.cpp
--- 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()
