彥隆 鄭
/
LGZDSensor
water sansor 1
watersensor.h@0:2b430503298a, 2017-10-27 (annotated)
- Committer:
- paris8022
- Date:
- Fri Oct 27 03:54:15 2017 +0000
- Revision:
- 0:2b430503298a
water sansor
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
paris8022 | 0:2b430503298a | 1 | const int VAL_PROBE = 0; |
paris8022 | 0:2b430503298a | 2 | const int ledPin = 13; |
paris8022 | 0:2b430503298a | 3 | |
paris8022 | 0:2b430503298a | 4 | void setup(){ |
paris8022 | 0:2b430503298a | 5 | pinMode(ledPin,OUTPUT); |
paris8022 | 0:2b430503298a | 6 | pinMode(sensor_in,INPUT); |
paris8022 | 0:2b430503298a | 7 | } |
paris8022 | 0:2b430503298a | 8 | |
paris8022 | 0:2b430503298a | 9 | void loop(){ |
paris8022 | 0:2b430503298a | 10 | if(digitalRead(sensor_in)== LOW){ |
paris8022 | 0:2b430503298a | 11 | digitalWrite(ledPin,HIGH); |
paris8022 | 0:2b430503298a | 12 | }else{ |
paris8022 | 0:2b430503298a | 13 | digitalWrite(ledPin,LOW); |
paris8022 | 0:2b430503298a | 14 | } |
paris8022 | 0:2b430503298a | 15 | } |