You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to compile for MSP430 (using Energia, a clone of Arduino IDE.) It fails to fit into memory unless you comment out all the float stuff. It would be nice if the library could be broken into two pieces: one that reads the raw values, and the float stuff that calculates UV index.
_lastUVA, _lastUVB are declared float but should be unsigned int? That is, I think they should be named _lastRawUVA and _lastRawUVB, the device yields 16-bit unsigned ints, and your code seems to assign unsigned ints to these variables, at which time an implicit float conversion is done.
This could be related to the issue #2 of values going negative. If the raw values are large so the MSB bit is set, then they are interpreted as negative numbers during the float conversion?
I could be wrong, I have only briefly looked at the code.
The text was updated successfully, but these errors were encountered:
I tried to compile for MSP430 (using Energia, a clone of Arduino IDE.) It fails to fit into memory unless you comment out all the float stuff. It would be nice if the library could be broken into two pieces: one that reads the raw values, and the float stuff that calculates UV index.
_lastUVA, _lastUVB are declared float but should be unsigned int? That is, I think they should be named _lastRawUVA and _lastRawUVB, the device yields 16-bit unsigned ints, and your code seems to assign unsigned ints to these variables, at which time an implicit float conversion is done.
This could be related to the issue #2 of values going negative. If the raw values are large so the MSB bit is set, then they are interpreted as negative numbers during the float conversion?
I could be wrong, I have only briefly looked at the code.
The text was updated successfully, but these errors were encountered: