Distanz-/Tiefenmesser mit JSN-SR40T
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.

ThreePositionSwitch.h 665B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * TreePositionSwitch.h
  3. *
  4. * Created on: 21.12.2025
  5. * Author: FSmilari
  6. */
  7. #ifndef THREEPOSITIONSWITCH_H_
  8. #define THREEPOSITIONSWITCH_H_
  9. #include "RotaryEncoder.h"
  10. #include "ExEzButton.h"
  11. class ThreePositionSwitch: public Loopable {
  12. private:
  13. int actualPosition;
  14. int Pos1_Pin;
  15. int Pos2_Pin;
  16. int Pos3_Pin;
  17. unsigned long lastDebounceTime = 0;
  18. unsigned long debounceTime = 50; // Standard 50 ms
  19. int lastReadPosition = -1;
  20. public:
  21. ThreePositionSwitch(int Pos1_Pin, int Pos2_Pin, int Pos3_Pin);
  22. int getPosition(void);
  23. void setDebounceTime(unsigned long time);
  24. void loop(void) override;
  25. };
  26. #endif /* THREEPOSITIONSWITCH_H_ */