firmware wip - add return RAW soilmoisture analog value
This commit is contained in:
parent
d396830026
commit
fb68dee829
2 changed files with 7 additions and 1 deletions
|
@ -162,8 +162,12 @@ int getSoilmoisture(byte moistureSensor, bool returnRAW = false) {
|
|||
soilmoisture = -1;
|
||||
}
|
||||
|
||||
if(returnRAW == true) {
|
||||
return soilmoisture;
|
||||
} else {
|
||||
return map(soilmoisture, wet, dry, 100, 0);
|
||||
}
|
||||
}
|
||||
|
||||
int getLightchirp() {
|
||||
// get the "light value" from I2C chirp module
|
||||
|
|
|
@ -1015,6 +1015,7 @@ void APIgetDebug() {
|
|||
// Chirp
|
||||
objSensors["chirp"]["temperature"] = getTemperature(2);
|
||||
objSensors["chirp"]["soilmoisture"] = getSoilmoisture(2);
|
||||
objSensors["chirp"]["soilmoistureRAW"] = getSoilmoisture(2, true);
|
||||
objSensors["chirp"]["light"] = getLightchirp();
|
||||
|
||||
// DHT11/22
|
||||
|
@ -1023,6 +1024,7 @@ void APIgetDebug() {
|
|||
|
||||
// Analog
|
||||
objSensors["analog"]["soilmoisture"] = getSoilmoisture(1);
|
||||
objSensors["analog"]["soilmoistureRAW"] = getSoilmoisture(1, true);
|
||||
objSensors["analog"]["waterlevel"] = getWaterlevel();
|
||||
|
||||
String body;
|
||||
|
|
Loading…
Reference in a new issue