Version 3.0: Switching to newer LDC1614 which is placed on the same PCB.

Dependencies:   Bob DS1825 LDC1614 LDC1101 SDFileSystem mbed

Fork of Inductive_Sensor by Bob Giesberts

Revision:
0:e81b68888268
Child:
1:22c272515015
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Dec 10 15:13:45 2015 +0000
@@ -0,0 +1,49 @@
+#include "mbed.h"
+#include "LDC1101.h"
+#include <iostream>
+using namespace std;
+
+
+// Feedback on console
+Serial pc(USBTX, USBRX);
+
+
+// Feedback with leds
+DigitalOut redled(PTB0); // Red
+DigitalOut greenled(PTB1); // Green
+void flash(int n){
+    for(int i = 0; i < n*2; i++){
+        redled = 1-redled;
+        greenled = 1-greenled;
+        wait(0.2);
+    }
+}
+
+
+// Main action
+int main(void){
+    
+    pc.printf("5x knipperen...\n");
+    flash(5);
+    
+
+    pc.printf("Contact maken met LDC1101...\n");
+    // mosi = PTC6           (PTD2)
+    // miso = PTC7           (PTD3)
+    // sck  = PTC5           (PTD1)
+    // cs   = PTC4           (PTB0)
+    // capacitor = 120E-12   (100E-12)
+    // f_external = 6.5E6    (6000000) 
+    // clock_out = PTA18?    (PTA13)
+    LDC1101 ldc(PTC6, PTC7, PTC5, PTC4, 120E-12, 6500000);
+
+
+    while(1)
+    {
+        flash(1);
+        
+        pc.printf("%4.0f",ldc.get_raw_l());
+        pc.printf(", %f \r\n", 1000000*ldc.getInductance());
+        wait_ms(250);
+    }
+}