claws / BH1750

An Arduino library for the digital light sensor breakout boards containing the BH1750FVI IC
MIT License
248 stars 107 forks source link

Compile warning #42

Closed guillaume-dorczynski closed 5 years ago

guillaume-dorczynski commented 6 years ago

Hi, thanks for that library, I like it :)

Except one warning when I compile it, for ESP32 on PlatformIO :

BH1750.cpp:144:21: warning: overflow in implicit constant conversion [-Woverflow] uint16_t level(NAN);

claws commented 6 years ago

Do you have an alternative that would remove the warning?

guillaume-dorczynski commented 6 years ago

Why not simply : uint16_t level = 0; ?

Edit: or : uint16_t level = (uint16_t)NAN; will compile with no warning.

claws commented 5 years ago

Resolved by #44.