upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
UPM module for the relay switch. The relay is a digital normally-open switch that uses low voltage or current to control a higher voltage and/or higher current. When closed, the indicator LED (if present) lights up and current is allowed to flow.
Public Member Functions | |
Relay (unsigned int pin) | |
~Relay () | |
mraa_result_t | on () |
mraa_result_t | off () |
bool | isOn () |
bool | isOff () |
std::string | name () |
Relay | ( | unsigned int | pin | ) |
relay constructor
pin | Pin to use |
~Relay | ( | ) |
relay destructor
mraa_result_t on | ( | ) |
Sets the relay switch to on (closed). This allows current to flow and lights up the indicator LED.
mraa_result_t off | ( | ) |
Sets the relay switch to off (open). This stops current from flowing and the indicator LED is not lit.
bool isOn | ( | ) |
Defines whether the relay switch is closed.
bool isOff | ( | ) |
Defines whether the relay switch is open.