| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- /*
- * Implementation of WLS.h
- *
- * Erstellt: 05.01.2021
- * Autor: Flo Smilari
- */
-
-
- #include "WLS.h"
-
- /*****************
- ** Constructors.
- ****************/
- WLS::WLS(int pin) : WLS(pin, false) {
- }
-
- WLS::WLS(int pin, bool _inverted) : ezButton(pin) {
- inverted = _inverted;
- }
-
- /******************
- ** Public methods
- *****************/
- bool WLS::isPlugged(void) {
- if (inverted)
- return isReleased();
- else
- return isPressed();
- }
-
- bool WLS::isUnplugged(void) {
- if (inverted)
- return isPressed();
- else
- return isReleased();
- }
-
-
- bool WLS::isConnected(void) {
- if (inverted) {
- return getStateRaw() == HIGH;
- } else {
- return getStateRaw() == LOW;
- }
- }
-
- void WLS::loop(void) {
- ezButton::loop();
- }
|