pyupm_light module¶
-
class
pyupm_light.
Light
(pin)[source]¶ Bases:
object
API for the Light Sensor.
ID: light
Name: Analog Light Sensor
Category: light
Manufacturer: seeed
Connection: analog
Kit: gsk The 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. A very approximate lux value can also be returned.
C++ includes: light.hpp
-
getAref
()[source]¶ float getAref()
Get sensor aref
dev: sensor context pointer
Sensor ADC reference voltage
-
getNormalized
()[source]¶ float getNormalized()
Read normalized value for sensor
dev: sensor context pointer
*value: Normalized value (0.0 -> 1.0)
Function result code
std::runtime_error: on error
-
getRawVolts
()[source]¶ float getRawVolts()
Read raw voltage from the sensor
dev: sensor context pointer
*value: Raw sensor voltage
Function result code
std::runtime_error: on error
-
raw_value
()[source]¶ float raw_value()
Gets the raw value from the AIO pin
Deprecated This function is deprecated use getNormalized() instead.
Raw value from the ADC
std::runtime_error: on error
-
setAref
(aref)[source]¶ void setAref(float aref)
Set ADC reference voltage
aref: ADC reference voltage
-
setOffset
(offset)[source]¶ void setOffset(float offset)
Set sensor offset. This offset is applied to the return value: value = value + offset
offset: count offset value used
Function result code
-