Latest code (with water)

This commit is contained in:
Nico Schottelius 2016-09-16 23:49:20 +02:00
parent 39825d2a0a
commit 3c817ce36a
1 changed files with 5 additions and 3 deletions

View File

@ -79,9 +79,6 @@ void setupLED() {
pinMode(LED_BLUE, OUTPUT); pinMode(LED_BLUE, OUTPUT);
} }
void setupWater() {
pinMode(WATER_SENSOR, INPUT);
}
// OTAA // OTAA
// Random numbers chosen + device id // Random numbers chosen + device id
@ -116,6 +113,11 @@ float readLight()
return (float)(1023-sensorValue)*10/sensorValue; return (float)(1023-sensorValue)*10/sensorValue;
} }
void setupWater() {
pinMode(WATER_SENSOR, INPUT);
}
boolean hasWater() boolean hasWater()
{ {
if(digitalRead(WATER_SENSOR) == LOW) { if(digitalRead(WATER_SENSOR) == LOW) {