GUVA-S12SD is used in Grove UV sensor
#include <GUVA-S12SD.h>
GUVAS12SD uv(A0);
void setup()
{
// Nothing TODO
}
void loop()
{
float mV = uv.read();
float uv_index = uv.index(mV);
Serial.println(uv_index);
}
GUVAS12SD(int connectedPinNo, float workingVoltage = 5.0, int samplingCount = 1000)
- Constructorfloat read()
- Return milli voltage by reading GUVA-S12SDfloat index(float read_mV)
- Calculate UV index from milli voltage
#index
returns float. As below when you need EPA UV index;
int epa_uv_index = (int) uv.index(uv.read()) + 1;
Apache 2.0
EoT;