upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
API for the Grove Relay. More...
UPM module for the Grove relay switch. The 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
pin | 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.