Tests the mbed Weapons and Systems Engineering Single Board Computer 12-bit ADC (MAX1270) by reading channel 0

Dependencies:   mbed mbedWSEsbc

Files at this revision

API Documentation at this revision

Comitter:
jebradshaw
Date:
Tue Feb 10 21:36:04 2015 +0000
Parent:
1:d68db4c0f92c
Commit message:
mbed WSE SBC analog to digital converter test (2 channels, +/- 10V)

Changed in this revision

WSESBC_ADC_Test.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show diff for this revision Revisions of this file
mbedWSEsbc.lib Show annotated file Show diff for this revision Revisions of this file
diff -r d68db4c0f92c -r e354e2fd124c WSESBC_ADC_Test.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WSESBC_ADC_Test.cpp	Tue Feb 10 21:36:04 2015 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+#include "mbedWSEsbc.h"
+
+DigitalOut myled(LED1);
+
+int main() {    
+    mbedWSEsbcInit(9600);   //Initialize the SBC
+    pc.printf("%s\r\n", __FILE__);  //print the program name
+        
+    while(1) {        
+        float ch0_volts = read_max1270_volts(0, 1, 1);
+        float ch1_volts = read_max1270_volts(1, 1, 1);
+        
+        pc.printf("t=%.2f  CH0=%.2fV  CH1=%.2fV\r\n", t.read(), ch0_volts, ch1_volts);        
+
+        led1 != led1;   //Toggle LED to indicate activity
+        wait(0.02);
+    }//while(1)
+}//main
diff -r d68db4c0f92c -r e354e2fd124c main.cpp
--- a/main.cpp	Thu Oct 16 18:02:22 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-#include "mbed.h"
-#include "mbedWSEsbc.h"
-
-DigitalOut myled(LED1);
-
-int main() {    
-    mbedWSEsbcInit(9600);   //Initialize the SBC
-    
-    while(1) {        
-        float ch0_volts = read_max1270_volts(0, 0, 0);
-        
-        pc.printf("t=%.2f  CH0=%.3fV    \r", t.read(), ch0_volts);        
-        led1 != led1;
-        wait(0.02);
-    }//while(1)
-}//main
diff -r d68db4c0f92c -r e354e2fd124c mbedWSEsbc.lib
--- a/mbedWSEsbc.lib	Thu Oct 16 18:02:22 2014 +0000
+++ b/mbedWSEsbc.lib	Tue Feb 10 21:36:04 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/jebradshaw/code/mbedWSEsbc/#c8950d434ba8
+http://mbed.org/users/jebradshaw/code/mbedWSEsbc/#9041603c430e