read better values

This commit is contained in:
Harald Pichler 2014-12-29 08:10:10 +01:00
parent df95393980
commit a8c87e3f54

View file

@ -59,6 +59,11 @@ extern uint16_t moisture_voltage;
static void
res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
{
int a=0;
for(a=0;a<10;a++){
digitalWrite(moisture_vcc, HIGH);
digitalWrite(moisture_vcc, LOW);
}
digitalWrite(moisture_vcc, HIGH);
moisture_voltage = analogRead(moisture_pin);
digitalWrite(moisture_vcc, LOW);