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

Dependencies:   mbed

Committer:
tbjazic
Date:
Thu Dec 18 09:27:05 2014 +0000
Revision:
0:c033c4dfdf94
Initial commit.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tbjazic 0:c033c4dfdf94 1 #include "mbed.h"
tbjazic 0:c033c4dfdf94 2
tbjazic 0:c033c4dfdf94 3 AnalogIn in(p17);
tbjazic 0:c033c4dfdf94 4 Serial pc(USBTX, USBRX);
tbjazic 0:c033c4dfdf94 5
tbjazic 0:c033c4dfdf94 6 int main() {
tbjazic 0:c033c4dfdf94 7 float value;
tbjazic 0:c033c4dfdf94 8 while(1) {
tbjazic 0:c033c4dfdf94 9 value = in;
tbjazic 0:c033c4dfdf94 10 pc.printf("\n\rValue received over analog in: %f", value);
tbjazic 0:c033c4dfdf94 11 wait(1);
tbjazic 0:c033c4dfdf94 12 }
tbjazic 0:c033c4dfdf94 13 }