UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

GroveLight Class

Module: grove
  • ID: grovelight
  • Name: Light Sensor
  • Category: light
  • Manufacturer: seeed
  • Connection: analog
  • Kit: gsk

The Grove light sensor detects the intensity of the ambient light. As the light intensity of the environment increases, the resistance of the sensor decreases. This means the raw value from the analog pin is larger in bright light and smaller in the dark. An approximate lux value can also be returned.
grovelight.jpg

Item Index

Methods

GroveLight

(
  • pin
)
Number

Grove analog light sensor constructor

Parameters:

  • pin Number

    Analog pin to use

Returns:

Number:

raw_value

() Number

Gets the raw value from the AIO pin

Returns:

Number:

Raw value from the ADC

value

() Number

Gets an approximate light value, in lux, from the sensor

Returns:

Number:

Normalized light reading in lux