bjorn grotenhuis
/
sensorzoeker
zoeksensor testprogramma
main.cpp@0:3595d15dd15c, 2017-06-01 (annotated)
- Committer:
- bjorntukkertje
- Date:
- Thu Jun 01 09:40:07 2017 +0000
- Revision:
- 0:3595d15dd15c
zoeksensor test programma
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bjorntukkertje | 0:3595d15dd15c | 1 | #include "mbed.h" |
bjorntukkertje | 0:3595d15dd15c | 2 | |
bjorntukkertje | 0:3595d15dd15c | 3 | AnalogIn sensor(A5); |
bjorntukkertje | 0:3595d15dd15c | 4 | PwmOut led (D2); |
bjorntukkertje | 0:3595d15dd15c | 5 | Serial pc(USBTX, USBRX); |
bjorntukkertje | 0:3595d15dd15c | 6 | |
bjorntukkertje | 0:3595d15dd15c | 7 | float a ; |
bjorntukkertje | 0:3595d15dd15c | 8 | int main () { |
bjorntukkertje | 0:3595d15dd15c | 9 | |
bjorntukkertje | 0:3595d15dd15c | 10 | while (1) { |
bjorntukkertje | 0:3595d15dd15c | 11 | a= sensor; |
bjorntukkertje | 0:3595d15dd15c | 12 | pc.printf("%f\n", a); |
bjorntukkertje | 0:3595d15dd15c | 13 | wait_ms(200); |
bjorntukkertje | 0:3595d15dd15c | 14 | led = 0.9; |
bjorntukkertje | 0:3595d15dd15c | 15 | } |
bjorntukkertje | 0:3595d15dd15c | 16 | } |
bjorntukkertje | 0:3595d15dd15c | 17 | |
bjorntukkertje | 0:3595d15dd15c | 18 | |
bjorntukkertje | 0:3595d15dd15c | 19 | |
bjorntukkertje | 0:3595d15dd15c | 20 | |
bjorntukkertje | 0:3595d15dd15c | 21 |