BULME_AHEL18
/
Linesensor
Geben sie die werte der Linesensoren über serial aus
Diff: main.cpp
- Revision:
- 0:9c84c26ec646
diff -r 000000000000 -r 9c84c26ec646 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Jun 18 09:32:59 2015 +0000 @@ -0,0 +1,28 @@ +#include "mbed.h" +#include "Serial_HL.h" +#include "Bertl14.h" +#include "BertlObjects.h" +#include "PwmOut.h" + +//Serial pc(USBTX, USBRX); // tx, rx +Serial pc(p9, p10); // tx, rx +AnalogIn linesensor1(P0_14); +AnalogIn linesensor2(P0_12); +AnalogIn linesensor3(P0_16); +AnalogIn linesensor4(P0_13); + +int main() +{ + double line1 = 0; + double line2 = 0; + double line3 = 0; + double line4 = 0; + while(1) { + line1 = linesensor1; + line2 = linesensor2; + line3 = linesensor3; + line4 = linesensor4; + pc.printf("%1.2f | %1.2f | %1.2f | %1.2f\r\n",line1, line2, line3, line4); + wait(0.5); + } +} \ No newline at end of file