Frästisch mit elektronischer Höhenverstellung mittels Schrittmotoren.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

WLS.cpp 755B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Implementation of WLS.h
  3. *
  4. * Erstellt: 05.01.2021
  5. * Autor: Flo Smilari
  6. */
  7. #include "WLS.h"
  8. /*****************
  9. ** Constructors.
  10. ****************/
  11. WLS::WLS(int pin) : WLS(pin, false) {
  12. }
  13. WLS::WLS(int pin, bool _inverted) : ezButton(pin) {
  14. inverted = _inverted;
  15. }
  16. /******************
  17. ** Public methods
  18. *****************/
  19. bool WLS::isPlugged(void) {
  20. if (inverted)
  21. return isReleased();
  22. else
  23. return isPressed();
  24. }
  25. bool WLS::isUnplugged(void) {
  26. if (inverted)
  27. return isPressed();
  28. else
  29. return isReleased();
  30. }
  31. bool WLS::isConnected(void) {
  32. if (inverted) {
  33. return getStateRaw() == HIGH;
  34. } else {
  35. return getStateRaw() == LOW;
  36. }
  37. }
  38. void WLS::loop(void) {
  39. ezButton::loop();
  40. }