From adb220110c3597c66fc26fe3c39bbaa160b4b53b Mon Sep 17 00:00:00 2001 From: James Hughes Date: Sat, 24 Sep 2022 03:28:15 -0600 Subject: [PATCH] properly casting int to float for UV Index calculation --- sensors.ino | 2 +- weather.ino | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sensors.ino b/sensors.ino index 7b6f215..ebd86d6 100644 --- a/sensors.ino +++ b/sensors.ino @@ -150,7 +150,7 @@ void readUV(struct sensorData *environment) { if (status.uv) { - environment->UVIndex = uv.readUV() / 100; + environment->UVIndex = (float) uv.readUV() / 100; } else { diff --git a/weather.ino b/weather.ino index 55d4257..1cf251b 100644 --- a/weather.ino +++ b/weather.ino @@ -4,12 +4,16 @@ // //Supporting the following project: https://www.instructables.com/Solar-Powered-WiFi-Weather-Station-V30/ -#define VERSION "1.3.2" +#define VERSION "1.3.3" //============================================= // Changelog //============================================= /* + * v1.3.3 + * 1. Corrected error with readUV casting an int result / 100. Now casting that operation as a float. I was always receiving a UVIndex of 0 + * + * * v1.3.2 * 1. I2C OLED diagnostics added (if needed) * 2.