test

Dependencies:   mbed

Committer:
mbaverso
Date:
Sat Jul 08 02:19:34 2017 +0000
Revision:
0:d0a11603dd8e
first commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbaverso 0:d0a11603dd8e 1 // Print messages when the AnalogIn is greater than 50%
mbaverso 0:d0a11603dd8e 2
mbaverso 0:d0a11603dd8e 3 #include "mbed.h"
mbaverso 0:d0a11603dd8e 4
mbaverso 0:d0a11603dd8e 5 AnalogIn lumens(p20);
mbaverso 0:d0a11603dd8e 6
mbaverso 0:d0a11603dd8e 7 int main() {
mbaverso 0:d0a11603dd8e 8 while(1) {
mbaverso 0:d0a11603dd8e 9 if(lumens > 0.5) {
mbaverso 0:d0a11603dd8e 10 printf("Too hot! (%f)", lumens.read());
mbaverso 0:d0a11603dd8e 11 }
mbaverso 0:d0a11603dd8e 12 }
mbaverso 0:d0a11603dd8e 13 }