test AnalogIn_Diff.lib for board K64F
Dependencies: AnalogIn_Diff_ok mbed
Diff: main.cpp
- Revision:
- 9:a9a333f3e760
- Parent:
- 8:1aae5c9ae98f
- Child:
- 10:fa287cb0f603
diff -r 1aae5c9ae98f -r a9a333f3e760 main.cpp --- a/main.cpp Fri Dec 05 15:46:02 2014 +0000 +++ b/main.cpp Fri Jan 08 08:37:59 2016 +0000 @@ -19,6 +19,7 @@ #define VERSION "AnalogIn_Diff_helloworld_2014_12_02" #define CIBLE "K64F" Serial pc(USBTX, USBRX); +AnalogIn_Diff adc_diff(ADC_DIFF(0,1)); Ticker flipperADC; bool flag_TX=false; void flipADC() @@ -27,12 +28,13 @@ } int main() { + pc.baud(115200); pc.printf("%s %s\r\n",VERSION,CIBLE); flipperADC.attach(&flipADC, 1.0); - AnalogIn_Diff adc_diff(ADC_DIFF(0,1)); + while (true) { if(flag_TX) { - pc.printf("V= %f \r\n",adc_diff.read()*6.6); + pc.printf("V= %f raw=%d\r\n",adc_diff.read()*6.6,adc_diff.read_raws16()); flag_TX=false; } }