A test program for my high speed analog input class.
Dependencies: mbed HighSpeedAnalogIn
Diff: main.cpp
- Revision:
- 0:29975cf64da2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Feb 04 22:17:40 2011 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" +#include "HighSpeedAnalogIn.h" + +BusOut chksig(p21, p22, p23, p24, p25, p26); +HighSpeedAnalogIn ain(p15, p16, p17, p18, p19, p20); +Ticker ticker; +volatile int cnt = 0; + +void func() { + printf("cnt=%d\n", cnt); + cnt = 0; +} + +int main() { + ticker.attach(&func, 1); + while (1) { + cnt++; + int val1 = ain.read(p15); + int val2 = ain.read(p16); + int val3 = ain.read(p17); + int val4 = ain.read(p18); + int val5 = ain.read(p19); + int val6 = ain.read(p20); + chksig = chksig + 1; + } +}