Welcome, Guest
Username: Password: Remember me

TOPIC: delay.h not found when using the BH1750 library

delay.h not found when using the BH1750 library 9 months 2 weeks ago #3350

  • Jansen
  • Jansen's Avatar
  • Offline
  • New Member
  • Posts: 12
  • Karma: 0
Hello,

I am trying to get my BH1750 light sensor to work with my esp8266 board. When I build I get the message C:\Program Files (x86)\Arduino\libraries\BH1750\BH1750.cpp:15:24: fatal error: util/delay.h: No such file or directory.

The library (and the sensor) works fine when I use my arduino nano so the library itself is OK.

I installed the esp8266 addon once via the boards manager and once via github. In both cases I get this error. I have no idea how to fix this problem. Can someone please help me?
The administrator has disabled public write access.

delay.h not found when using the BH1750 library 9 months 6 days ago #3376

  • edautz
  • edautz's Avatar
  • Offline
  • New Member
  • Posts: 2
  • Karma: 0
I got also this error.

I solved using the library of Sermus:

github.com/Sermus/ESP8266_ArduinoIDE/tre.../libraries/BH1750FVI instead of the default library.

But the syntax of the examples makes no sense:

After experimenting and studing the library source I discovered the right syntax:

In the start of the sketch:

BH1750FVI LightSensor(0x23); //Default I2C adres when connecting the addr pin to ground.

void setup():

LightSensor.begin();
LightSensor.setMode(BH1750_Continuous_H_resolution_Mode); //or another mode if you like.

void loop():
Lux = LightSensor.getLightIntensity();// Get Lux value

This works stable and fine in my setup using NodeMCU V3 and ESP8266 board manager 2.0.0.
Last Edit: 9 months 6 days ago by edautz.
The administrator has disabled public write access.
Time to create page: 0.151 seconds
Powered by Kunena Forum