DipCortex - Read 7 Analog channels and stream the data over USB CDC
Fork of DipCortex-ADC-USB by
Read 7 analog channels and stream the results over a USB CDC connection. Using the DIpCortex
main.cpp
- Committer:
- SolderSplashLabs
- Date:
- 2013-11-02
- Revision:
- 1:ec3a6a7c1aba
- Parent:
- 0:21219957a1ae
File content as of revision 1:ec3a6a7c1aba:
/** * USB ADC - Stream 7 ADC channels over USB CDC */ #include "mbed.h" #include "USBSerial.h" USBSerial pc; // Configure the Analogue pins of the DipCortex AnalogIn adc0(P0_11); //P2 AnalogIn adc1(P0_12); //P3 AnalogIn adc2(P0_13); //P4 AnalogIn adc3(P0_14); //P5 AnalogIn adc5(P0_16); //P8 AnalogIn adc6(P0_22); //P9 AnalogIn adc7(P0_23); //P10 int main() { while (1) { pc.printf("ADC0, %d, ADC1, %d, ADC2, %d, ADC3, %d, ADC5, %d, ADC6, %d, ADC7, %d\r\n", adc0.read_u16(), adc1.read_u16(), adc2.read_u16(), adc3.read_u16(), adc5.read_u16(), adc6.read_u16(), adc7.read_u16()); } }