measuring the salinity
Dependencies: LinearAnalogSensors mbed
Fork of mbed_measuring_temperature by
main.cpp@0:da915495c7fc, 2016-05-31 (annotated)
- Committer:
- ekasinambela
- Date:
- Tue May 31 10:41:47 2016 +0000
- Revision:
- 0:da915495c7fc
- Child:
- 1:6476db5e52e8
receive input from keyboard to control the led
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ekasinambela | 0:da915495c7fc | 1 | #include "mbed.h" |
ekasinambela | 0:da915495c7fc | 2 | |
ekasinambela | 0:da915495c7fc | 3 | Serial pc(USBTX, USBRX); |
ekasinambela | 0:da915495c7fc | 4 | DigitalOut myled1(LED1), myled2(LED2); |
ekasinambela | 0:da915495c7fc | 5 | |
ekasinambela | 0:da915495c7fc | 6 | int main() { |
ekasinambela | 0:da915495c7fc | 7 | |
ekasinambela | 0:da915495c7fc | 8 | while(1) { |
ekasinambela | 0:da915495c7fc | 9 | char c = pc.getc(); |
ekasinambela | 0:da915495c7fc | 10 | if (c=='q'){ |
ekasinambela | 0:da915495c7fc | 11 | myled1 = 1; |
ekasinambela | 0:da915495c7fc | 12 | wait(0.2); |
ekasinambela | 0:da915495c7fc | 13 | myled1 = 0; |
ekasinambela | 0:da915495c7fc | 14 | wait(0.2); |
ekasinambela | 0:da915495c7fc | 15 | } |
ekasinambela | 0:da915495c7fc | 16 | |
ekasinambela | 0:da915495c7fc | 17 | if (c=='w'){ |
ekasinambela | 0:da915495c7fc | 18 | myled2 = 1; |
ekasinambela | 0:da915495c7fc | 19 | wait(0.2); |
ekasinambela | 0:da915495c7fc | 20 | myled2 = 0; |
ekasinambela | 0:da915495c7fc | 21 | wait(0.2); |
ekasinambela | 0:da915495c7fc | 22 | } |
ekasinambela | 0:da915495c7fc | 23 | |
ekasinambela | 0:da915495c7fc | 24 | } |
ekasinambela | 0:da915495c7fc | 25 | } |