DipCortex - Read 7 Analog channels and stream the data over USB CDC

Dependencies:   USBDevice mbed

Fork of DipCortex-ADC-USB by Carl - SolderSplash Labs

Read 7 analog channels and stream the results over a USB CDC connection. Using the DIpCortex

http://www.soldersplash.co.uk

Files at this revision

API Documentation at this revision

Comitter:
SolderSplashLabs
Date:
Sat Nov 02 12:22:33 2013 +0000
Child:
1:ec3a6a7c1aba
Commit message:
DipCortex 7 Channel USB Stream over USB CDC

Changed in this revision

USBDevice.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USBDevice.lib	Sat Nov 02 12:22:33 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/SolderSplashLabs/code/USBDevice/#01e56c952fe0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Nov 02 12:22:33 2013 +0000
@@ -0,0 +1,26 @@
+/**
+ * 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());
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.lib	Sat Nov 02 12:22:33 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/#f37f3b9c9f0b