Code Monkey home page Code Monkey logo

bh1750fvi's People

Contributors

per1234 avatar peterembedded avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bh1750fvi's Issues

Checking the sensor available

Hi!
I am used your library, works good.
But , I have a question.
How can I check that the sensor is working good?
This library is has any function to do this or I have to do a simple I2C address check on other way?
For example: checking the address before read light value from the sensor.

Thanks.

setSensitivity available?

Hi. I've seen similar libraries for the BH1750, that has a sensitivity setting set with LightSensor.SetSensitivity.
"LightSensor.SetSensitivity(1.00);** - Changes the sensitivity of the sensor by changing the measurement time without re-scaling the resulting value. Thus increasing the sensitivity compensates for something partially blocking light to the sensor. The range in scaling is 0.45 to 3.68. Default is 1.00"
reason I'm looking for this, is that my sensor sits where readings are too low (0 or 1 most of the time).
Is this feature available in your implementation, or is there some workaround to achieve same result ?
Thanks

Error in calculation in mode "H-Resolution Mode2"

There is an error in the calculation of the brightness in mode "H-Resolution Mode2".
In this mode the value must be divided by two again to get the correct brightness.

Reproducibility:
Switch between "H-Resolution Mode" and "H-Resolution Mode2" to see that the value is suddenly halved.

https://www.mouser.com/datasheet/2/348/bh1750fvi-e-186247.pdf on page 11

H-reslution mode : Illuminance per 1 count ( lx / count ) = 1 / 1.2 *( 69 / X )
H-reslution mode2 : Illuminance per 1 count ( lx / count ) = 1 / 1.2 *( 69 / X ) / 2

Getting corrupted data

I did the asked connection and my code is also similar to your's but when I run the program I am getting corrupted data in my serial monitor.

Arduino UNO not working

Hi I am trying to use your library on an Arduino UNO. I have the SCL pin on A4 and DAT pin on A5.

All I am getting is lux value of 54612

Here is my code:

/*
This is a simple example to test the BH1750 Light sensor

Connect the sensor to a NodeMCU ESP8266:
VCC <-> 3V3 [grey]
GND <-> Gnd [purple]
SDA <-> D2 [green]
SCL <-> D1 [blue]
ADDR <-> RX [yellow]
*/

#include <Wire.h>
#include <BH1750FVI.h>

// Settings

int addressPin = A4;
int devicePin = A5;
BH1750FVI::eDeviceMode_t DEVICEMODE = BH1750FVI::k_DevModeContHighRes;

// Create the Lightsensor instance
BH1750FVI LightSensor(addressPin, devicePin, DEVICEMODE);

void setup()
{
Serial.begin(9600);
LightSensor.begin();
Serial.println("Running...");
}

void loop()
{
uint16_t lux = LightSensor.GetLightIntensity();
Serial.print("Light level: ");
Serial.println(lux);
delay(2000);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.