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:
- 0:21219957a1ae
- Child:
- 1:ec3a6a7c1aba
File content as of revision 0:21219957a1ae:
/** * 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(p2); AnalogIn adc1(p3); AnalogIn adc2(p4); AnalogIn adc3(p5); AnalogIn adc5(p8); AnalogIn adc6(p9); AnalogIn adc7(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()); } }