upm
0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
|
API for the Grove Relay. More...
UPM module for the Grove relay switch. Grove 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 lights up and current is allowed to flow.
Public Member Functions | |
GroveRelay (unsigned int pin) | |
~GroveRelay () | |
mraa_result_t | on () |
mraa_result_t | off () |
bool | isOn () |
bool | isOff () |
Public Member Functions inherited from Grove | |
std::string | name () |
Additional Inherited Members | |
Protected Attributes inherited from Grove | |
std::string | m_name |
GroveRelay | ( | unsigned int | pin | ) |
Grove relay constructor
gpio | Pin to use |
~GroveRelay | ( | ) |
Grove 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.