grove grove (GL5528 LDR) Light sensor class
Spaniakos - grove (GL5528 LDR) Light sensor class
LUX.ino

For Arduino
updated: spaniakos 2015

In this example a simple readingof the sensor value is printed into Serial.
the valueis first converted to LUX using class functions.

#include <SPI.h>
#include <LightSensor.h>
int LightPin = A2;
int LightThres = 3;
char Light[6];
LightSensor LS(LightPin,LightThres);
void setup() {
LS.begin();
}
void loop() {
LS.Light_To_Lux();
Serial.print("Lux :");
Serial.println(LS.Value());
delay(1000);
}