Rob Toulson
/
PE_05-04_LoggingData
Revision 0:ec4e2bc1996f, committed 2012-10-15
- Comitter:
- robt
- Date:
- Mon Oct 15 21:18:35 2012 +0000
- Commit message:
- by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
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 |
diff -r 000000000000 -r ec4e2bc1996f main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Oct 15 21:18:35 2012 +0000 @@ -0,0 +1,17 @@ +/*Program Example 5.4: Reads input voltage through the ADC, and transfers to PC terminal + */ +#include "mbed.h" +Serial pc(USBTX, USBRX); //enable serial port which links to USB +AnalogIn Ain(p20); + +float ADCdata; + +int main() { + pc.printf("ADC Data Values...\n\r"); //send an opening text message + while(1){ + ADCdata=Ain; + wait(0.5); + pc.printf("%1.3f \n\r",ADCdata); //send the data to the terminal + } +} +
diff -r 000000000000 -r ec4e2bc1996f mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Oct 15 21:18:35 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/cd19af002ccc \ No newline at end of file