Diferencia entre revisiones de «Medidor de parpadeo de luz»

Sin resumen de edición
Línea 20: Línea 20:
const int COLLECTION_MS = 200;
const int COLLECTION_MS = 200;
const int SENSOR_LIMIT = 850;
const int SENSOR_LIMIT = 850;
const int SENSOR_BAJO = 200;


I2C_LCD lcd(39);
I2C_LCD lcd(39);
Línea 42: Línea 43:
   if (x_max > SENSOR_LIMIT) {
   if (x_max > SENSOR_LIMIT) {
     lcd.center(1, "demasiada luz");
     lcd.center(1, "demasiada luz");
  } else if (x_max < SENSOR_BAJO) {
    lcd.center(1, "falta de luz");
   } else {
   } else {
     float ratio = (float)x_min / x_max;
     float ratio = (float)x_min / x_max;
Línea 47: Línea 50:
   }
   }
}
}
</pre>
</pre>