Arduino Light Sensor Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld
Arduino Light Sensor Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld

Take advantage of the light sensor available on your smartphone to trigger a hardware actions.

This shield is one of the sensor shields. Sensor shields allows you to tap into your smartphone’s sensors and use in prototyping with Arduino, you can get information from the surrounding environment and use
it to trigger a certain action.Learn more from the sensor shields tutorial.

Light sensors ”Photodetectors” measures the ambient light level in Lux’s. Light sensor Library allows arduino to get sensed light data from the smartphone’s light sensor.

Adding #define CUSTOM_SETTINGS along with #define INCLUDE_LIGHT_SENSOR_SHIELD is a key that will let you unlock the Light sensor shield only amongst all shields and prevent 1Sheeld library from eating your memory specially for UNO board.

unsigned long getValue(void)

Get sensed light values from the light sensor from smartphone.

 

SYNTAX
LightSensor.getValue();

 

RETURNS
Returns an unsinged long value holding the light data.

 

PARAMETERS
None.

 

USAGE
unsigned long value = LightSensor.getValue();

 

void setOnValueChange(void(*userFunction)(unsigned long))

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a new value of light is sensed from light sensor.

 

SYNTAX
LightSensor.setOnValueChange(&userFunctionName);

 

RETURNS
None.

 

PARAMETERS
&userFunctionName: takes the physical address of the userFunction in the memory and jump to it once called to execute it’s functionality.

 

USAGE
LightSensor.setOnValueChange(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new value is sensed by the light sensor. */
void myFunction (unsigned long lightValue)
{
    /*Print out the light values on the Terminal of the application. */
    Terminal.println(lightValue);
}