A simple program that receives a value over analog input and displays it on a terminal.

Dependencies:   mbed

main.cpp

Committer:
tbjazic
Date:
2014-12-18
Revision:
0:c033c4dfdf94

File content as of revision 0:c033c4dfdf94:

#include "mbed.h"

AnalogIn in(p17);
Serial pc(USBTX, USBRX);

int main() {
    float value;
    while(1) {
        value = in;
        pc.printf("\n\rValue received over analog in: %f", value);
        wait(1);
    }
}