Bill Jack
/
part1
Completed Part 1
Revision 0:613255191ca1, committed 2016-02-24
- Comitter:
- ese350billjack
- Date:
- Wed Feb 24 01:16:39 2016 +0000
- Commit message:
- Reading ADC pin 15
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 613255191ca1 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Feb 24 01:16:39 2016 +0000 @@ -0,0 +1,12 @@ +#include "mbed.h" +#include <iostream> +AnalogIn ain(A0); + +int main() { + while (1) { + // test the voltage on the initialized analog pin + // and if greater than 0.3 * VCC set the digital pin + // to a logic 1 otherwise a logic 0 + cout << ain.read() << "\n"; + } +}
diff -r 000000000000 -r 613255191ca1 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Feb 24 01:16:39 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/252557024ec3 \ No newline at end of file