BH1750 Light Sensor and Teensy 3.2 compatible?

Status
Not open for further replies.
I am getting a response from the sensor but it is an erroneous number and not a true sensor reading. I believe this is because there is something wrong with my wiring.

I have the SDA pin of the sensor going to Pin 18 and SCL going to Pin 19 on the Teensy 3.2

Code:
#define HWSERIAL Serial1
#include <MFRC522.h>
#include <SPI.h>
#include <Wire.h>
#include "BH1750FVI.h"

BH1750FVI LightSensor;

void setup() {
  HWSERIAL.begin(9600);
  LightSensor.begin();
  LightSensor.SetAddress(0x5C);
  LightSensor.SetMode(Continuous_H_resolution_Mode);
}

void loop() {
  
  uint16_t lux = LightSensor.GetLightIntensity();
  HWSERIAL.print("Lux = ");HWSERIAL.print(lux);
  
}
 
Last edited:
Status
Not open for further replies.
Back
Top