Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

BH1750 reporting -10924 #520

Open
user2684 opened this issue May 24, 2020 · 2 comments
Open

BH1750 reporting -10924 #520

user2684 opened this issue May 24, 2020 · 2 comments
Labels

Comments

@user2684
Copy link
Contributor

No description provided.

@user2684 user2684 added the bug label May 24, 2020
@Bottesford
Copy link

This is due to the use of INT in the SensorBH1750 class. When values are too high they go negative.
I fixed mine by changing :
new Child(this,INT,nodeManager.getAvailableChildId(child_id),S_LIGHT_LEVEL,V_LEVEL,_name);
to:
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id),S_LIGHT_LEVEL,V_LEVEL,_name);

and:
int value = _lightSensor->readLightLevel();
to:
float value = _lightSensor->readLightLevel();

@user2684
Copy link
Contributor Author

Thanks a lot for the advice, will apply the same approach in the fix!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants