John Dickerson
/
AnalogOutIn
Sine wave out DAC and received in ADC and then sent out serial port
Revision 0:8f5eafbf1fa2, committed 2015-06-05
- Comitter:
- JohnDickerson
- Date:
- Fri Jun 05 23:51:16 2015 +0000
- Commit message:
- Hello
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jun 05 23:51:16 2015 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" + +AnalogOut aout(PTE30); +AnalogIn ain(PTC2); +Serial pc(USBTX,USBRX); +DigitalOut myled(LED_GREEN); + +int main() { + int i=0; + float g[100]; + myled=0; + while(i<100) { + aout = (1.0+(sin(2*3.14159*i/100.0)))/2.0; + g[i]= ain; + wait(.01); + myled = !myled; + i++; + } + i=0; + while(i<100) { + pc.printf("%f \n",g[i]); + i++; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Jun 05 23:51:16 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9c8f0e3462fb \ No newline at end of file