Skip to content

Commit

Permalink
properly casting int to float for UV Index calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
jhughes1010 committed Sep 24, 2022
1 parent d329e88 commit adb2201
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sensors.ino
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void readUV(struct sensorData *environment)
{
if (status.uv)
{
environment->UVIndex = uv.readUV() / 100;
environment->UVIndex = (float) uv.readUV() / 100;
}
else
{
Expand Down
6 changes: 5 additions & 1 deletion weather.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit adb2201

Please sign in to comment.