upm
1.5.0
Sensor/Actuator repository for libmraa (v1.8.0)
|
API for the LED. More...
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.
Public Member Functions | |
Led (int pin) | |
~Led () | |
mraa_result_t | write (int value) |
mraa_result_t | off () |
mraa_result_t | on () |
std::string | name () |
Led | ( | int | pin | ) |
LED constructor
pin | Pin to use |
~Led | ( | ) |
LED destructor
mraa_result_t write | ( | int | 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.
value | Tells the LED to turn on (for values >=1) or off (for values <1) |
mraa_result_t off | ( | ) |
Turns the LED off
mraa_result_t on | ( | ) |
Turns the LED on