Hello Everyone, Im new here in blynk community.
Last night I put together a code for my BH1750 Lightmeter and it works fine but I have some issues with the widget in the blynk app.
It seems that the widgets will not show higher values then 1023 and we all know that a sunny day reads way higher levels then 1023.
Is there any way to set the widgets to reach higher levels then 1023 ?
Below you can se my code (Im not sure if its the right way to post the code like that, I tried to find out but could not find it so if it is wrong please let me know and I will correct it).
As I am a newbie to both the arduino language and blynk I would be happy if your answers are not to complicated.
MY CODE:
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <Wire.h>
#include <BH1750.h>
BH1750 lightMeter;
char auth[] = "-----------";
char ssid[] = "-----------";
char pass[] = "-----------"
SimpleTimer timer;
/********************************************************************************************/
void sendUptime(){
uint16_t lux = lightMeter.readLightLevel();
Blynk.virtualWrite(V5, lux);
}
void setup(){
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
// Initialize the I2C bus (BH1750 library doesn't do this automatically)
Wire.begin();
// On esp8266 you can select SCL and SDA pins using Wire.begin(D4, D3);
timer.setInterval(1000L, sendUptime); // Temperature sensor read interval. 2000 (ms) = 2 seconds.
lightMeter.begin();
}
void loop() {
Blynk.run();
timer.run();
}