Yes that is where I am encountering challenges I tried but this too is not working.
{
int uvLevel = averageAnalogRead(UVOUT);
int refLevel = averageAnalogRead(REF_3V3);
float uvIntensity = 15.0;
if (uvIntensity > 11.0)
{
//Use the 3.3V power pin as a reference to get a very accurate output value from sensor
float outputVoltage = 3.3 / refLevel * uvLevel;
float uvIntensity = mapfloat(outputVoltage, 0.99, 2.9, 0.0, 15.0);
digitalWrite (buzzer, HIGH);
Serial.print("MP8511 output: ");
Serial.print(uvLevel);
Serial.print(" MP8511 voltage: ");
Serial.print(outputVoltage);
lcd.setCursor(4,1);
lcd.print("UV Intensity:");
lcd.setCursor(0,1);
lcd.print(uvIntensity);
delay(1000);
lcd.clear();
}
else
{
digitalWrite(buzzer, LOW);
}
}