testprogramma zoek sensor

Dependencies:   mbed

Committer:
bjorntukkertje
Date:
Thu Jun 01 09:42:55 2017 +0000
Revision:
0:b970b568d832
zoeksensor test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bjorntukkertje 0:b970b568d832 1 #include "mbed.h"
bjorntukkertje 0:b970b568d832 2
bjorntukkertje 0:b970b568d832 3 AnalogIn sensor(A5);
bjorntukkertje 0:b970b568d832 4 PwmOut led (D2);
bjorntukkertje 0:b970b568d832 5 Serial pc(USBTX, USBRX);
bjorntukkertje 0:b970b568d832 6
bjorntukkertje 0:b970b568d832 7 float a ;
bjorntukkertje 0:b970b568d832 8 int main () {
bjorntukkertje 0:b970b568d832 9
bjorntukkertje 0:b970b568d832 10 while (1) {
bjorntukkertje 0:b970b568d832 11 a= sensor;
bjorntukkertje 0:b970b568d832 12 pc.printf("%f\n", a);
bjorntukkertje 0:b970b568d832 13 wait_ms(200);
bjorntukkertje 0:b970b568d832 14 led = 0.9;
bjorntukkertje 0:b970b568d832 15 }
bjorntukkertje 0:b970b568d832 16 }
bjorntukkertje 0:b970b568d832 17
bjorntukkertje 0:b970b568d832 18
bjorntukkertje 0:b970b568d832 19
bjorntukkertje 0:b970b568d832 20
bjorntukkertje 0:b970b568d832 21