Hello,
I'm having issues with my code, apparently is getting stuck in the first IF statement.
I will appreciate any guidance to eliminate this problem.
Here is that portion of the code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
String UVIndex;
int sensorValue;
void setup()
{
Serial.begin(9600);
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print("UV Ind = ");
}
void loop()
{
lcd.setCursor(9, 0);
if (sensorValue < 10)
{
lcd.println("0 LOW");
delay(1000);
lcd.println("\n");
}
else if (sensorValue > 10 && sensorValue <= 12)
{
lcd.println("0 LOW");
delay(1000);
lcd.println("\n");
}
else if (sensorValue > 12 && sensorValue <= 15)
{
lcd.println("1 LOW");
delay(1000);
lcd.println("\n");
}
else if (sensorValue > 15 && sensorValue <= 20)
{
lcd.println("2 MED");
delay(1000);
lcd.println("\n");
}
else if (sensorValue > 20 && sensorValue <= 50)
{
lcd.println("3 HIGH");
delay(1000);
lcd.println("\n");
}