From f8b53f993ac61e470bcc1ee321c16a0657cf161d Mon Sep 17 00:00:00 2001 From: Gustavoeklund01 Date: Tue, 21 Oct 2025 16:48:30 -0300 Subject: sensor luz correto --- esp/BH1750.ino | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'esp') diff --git a/esp/BH1750.ino b/esp/BH1750.ino index e69de29..9d4f9c9 100644 --- a/esp/BH1750.ino +++ b/esp/BH1750.ino @@ -0,0 +1,21 @@ +#include +#include + +BH1750 lightMeter; + +void setup(){ + Serial.begin(115200); + Wire.begin(21, 22); + lightMeter.begin(); + Serial.println("Teste sensor luminosidade"); +} +void loop(){ + float lux = + lightMeter.readLightLevel(); + + Serial.print("Luminosidade: "); + Serial.print(lux); + Serial.println(" lux"); + + delay(1000); +} \ No newline at end of file -- cgit v1.2.3