Skip to content

Hello, the library dont really want to work with my esp32s, anyone? #56

Description

@marius240

my code:

#include <Wire.h>

BH1750 lightMeter(0x5C);

void setup() {
  // put your setup code here, to run once:
  Wire.begin();
  Serial.begin(115200);
  lightMeter.begin(BH1750::CONTINUOUS_HIGH_RES_MODE);
  delay(2000);

}

void loop() {
  // put your main code here, to run repeatedly:

  uint16_t lux = lightMeter.readLightLevel();
  Serial.print("Light level: ");
  Serial.println(lux);

  delay(5000);


}

The cabling:

D21 -> SDA
D22 -> SCL
GND & ADDR -> gnd
VCC -> 3.3V

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions