Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGyver committed May 21, 2021
1 parent b7d0a01 commit 1035858
Show file tree
Hide file tree
Showing 3 changed files with 374 additions and 356 deletions.
6 changes: 5 additions & 1 deletion EncButton/EncButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Опциональный режим callback (+22б SRAM на каждый экземпляр)
v1.1 - пуллап отдельныи методом
v1.2 - можно передать конструктору параметр INPUT_PULLUP
*/

// =========== НАСТРОЙКИ (можно передефайнить из скетча) ============
Expand Down Expand Up @@ -63,7 +64,10 @@ enum eb_callback {
// класс
template < bool MODE, uint8_t S1, uint8_t S2 = 255, uint8_t KEY = 255 >
class EncButton {
public:
public:
EncButton(byte mode = INPUT) {
if (mode == INPUT_PULLUP) pullUp();
}
void pullUp() {
if (S2 == 255) { // обычная кнопка
pinMode(S1, INPUT_PULLUP);
Expand Down
Loading

0 comments on commit 1035858

Please sign in to comment.