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

Dependencies:   mbed mbedWSEsbc

WSESBC_ADC_Test.cpp

Committer:
jebradshaw
Date:
2015-02-10
Revision:
2:e354e2fd124c

File content as of revision 2:e354e2fd124c:

#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