Led Class
- ID: led
- Name: Light-emitting Diode (LED)
- Other Names: Grove LED
- Category: led
- Manufacturer: seeed
- Connection: gpio
- Kit: gsk
UPM module for the LED (or other similar light-emitting diodes). An LED is a p-n junction semiconductor which emits light in response to voltage. The longer wire of an LED connects to the positive seat (anode); the shorter wire connects to the negative seat (cathode). The flat side of the bulb corresponds to the cathode, while the rounded side corresponds to the anode.
Methods
Led
-
pin
LED constructor
Parameters:
-
pin
NumberPin to use
Returns:
Led
-
name
LED constructor
Parameters:
-
name
StringLinux gpioled device name
Returns:
write
-
value
Turns the LED on or off, depending on the value. If the value is positive (greater than or equal to 1), the LED is turned on. Otherwise, for 0 or negative values, the LED is turned off.
Parameters:
-
value
NumberTells the LED to turn on (for values >=1) or off (for values <1)
Returns:
0 if successful, non-zero otherwise
off
()
Upm_result_t
Turns the LED off
Returns:
0 if successful, non-zero otherwise
on
()
Upm_result_t
Turns the LED on
Returns:
0 if successful, non-zero otherwise