A simple program that sends a value over analog output.

Dependencies:   mbed

Committer:
tbjazic
Date:
Thu Dec 18 09:24:09 2014 +0000
Revision:
0:768f66ec3284
Initial commit.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tbjazic 0:768f66ec3284 1 #include "mbed.h"
tbjazic 0:768f66ec3284 2
tbjazic 0:768f66ec3284 3 AnalogOut out(p18);
tbjazic 0:768f66ec3284 4 Serial pc(USBTX, USBRX);
tbjazic 0:768f66ec3284 5
tbjazic 0:768f66ec3284 6 int main() {
tbjazic 0:768f66ec3284 7 float value;
tbjazic 0:768f66ec3284 8 while(1) {
tbjazic 0:768f66ec3284 9 pc.printf("\n\rEnter value to send over analog out: ");
tbjazic 0:768f66ec3284 10 pc.scanf("%f", &value);
tbjazic 0:768f66ec3284 11 out = value;
tbjazic 0:768f66ec3284 12 wait(10);
tbjazic 0:768f66ec3284 13 }
tbjazic 0:768f66ec3284 14 }