A simple differential A2D demo

Dependencies:   AnalogIn_Diff mbed

Files at this revision

API Documentation at this revision

Comitter:
JimCarver
Date:
Tue May 20 01:03:44 2014 +0000
Parent:
0:57c0d1d282bf
Child:
2:ce56cf821e38
Commit message:
A simple demo of Differential 16 bit Analog to Digital conversion on a K64F platform

Changed in this revision

AnalogIn_Diff.lib Show annotated file Show diff for this revision Revisions of this file
C12832.lib Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/AnalogIn_Diff.lib	Tue May 20 01:03:44 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/JimCarver/code/AnalogIn_Diff/#0f6f4be28e21
--- a/C12832.lib	Mon May 19 15:10:40 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/MACRUM/code/C12832/#033a554bd03e
--- a/main.cpp	Mon May 19 15:10:40 2014 +0000
+++ b/main.cpp	Tue May 20 01:03:44 2014 +0000
@@ -1,21 +1,23 @@
 #include "mbed.h"
-#include "C12832.h"
+#include "AnalogIn_Diff.h"
 
-C12832 lcd(D11, D13, D12, D7, D10); // App shield LCD
-AnalogIn p1( A0);
-AnalogIn p2( A1);
+Serial pc(USBTX, USBRX);
+
+
+
 
 int main() {
-uint16_t r1, r2;
-lcd.cls();
-lcd.locate(0,1);
-lcd.printf("K64F A2D");
+int16_t  d1; 
+float f;
+pc.printf("Differential A/D Test\r\n");
+AnalogIn_Diff a2d(0);
+printf("Running\r\n\n");
 
     while (true) {
-        r1 = p1.read_u16();
-        r2 = p2.read_u16();
-        lcd.locate(0,1);
-        lcd.printf("K64F A2D\nP1= %04X\nP2= %04X", r1, r2);
-        wait(0.1);
+
+        d1 = a2d.read_16();
+        f = a2d.read();
+        pc.printf("Result= %f, %d\r\n", f, d1);
+        wait(0.2);
     }
 }
\ No newline at end of file