Completed Part 1

Dependencies:   mbed

main.cpp

Committer:
ese350billjack
Date:
2016-02-24
Revision:
0:613255191ca1

File content as of revision 0:613255191ca1:

#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";
    }
}