50 #define UV_SENSOR_ANALOG_PIN 0
54 uint32_t SLEEP_TIME = 30*1000;
61 uint16_t uvIndexValue [12] = { 50, 227, 318, 408, 503, 606, 696, 795, 881, 976, 1079, 1170};
75 uint32_t currentTime = millis();
77 uint16_t uv = analogRead(UV_SENSOR_ANALOG_PIN);
86 for (i = 0; i < 12; i++) {
87 if (uv <= uvIndexValue[i]) {
95 float vRange=uvIndexValue[i]-uvIndexValue[i-1];
96 float vCalc=uv-uvIndexValue[i-1];
97 uvIndex+=(1.0/vRange)*vCalc-1.0;
104 if ((uvIndex != lastUV)||(currentTime-lastSend >= 5UL*60UL*1000UL)) {
105 lastSend=currentTime;