diff options
| author | Gustavoeklund01 <eklundgu@gmail.com> | 2025-10-21 16:48:30 -0300 |
|---|---|---|
| committer | Gustavoeklund01 <eklundgu@gmail.com> | 2025-10-21 16:48:30 -0300 |
| commit | f8b53f993ac61e470bcc1ee321c16a0657cf161d (patch) | |
| tree | a83df4e8475757943773fc8c34da3023967ba03b | |
| parent | 20e9d39d81a89a2ee8707321540458dcba85c3cf (diff) | |
sensor luz correto
| -rw-r--r-- | esp/BH1750.ino | 21 |
1 files changed, 21 insertions, 0 deletions
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 <Wire.h> +#include <BH1750.h> + +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 |
