Bill Jack
/
part1
Completed Part 1
Diff: main.cpp
- Revision:
- 0:613255191ca1
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"; + } +}