Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
GyverLibs committed Feb 18, 2022
1 parent f742fcc commit f729267
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Foo](https://img.shields.io/badge/Version-1.19.4-brightgreen.svg?style=flat-square)](#versions)
[![Foo](https://img.shields.io/badge/Version-1.20-brightgreen.svg?style=flat-square)](#versions)
[![Foo](https://img.shields.io/badge/Website-AlexGyver.ru-blue.svg?style=flat-square)](https://alexgyver.ru/)
[![Foo](https://img.shields.io/badge/%E2%82%BD$%E2%82%AC%20%D0%9D%D0%B0%20%D0%BF%D0%B8%D0%B2%D0%BE-%D1%81%20%D1%80%D1%8B%D0%B1%D0%BA%D0%BE%D0%B9-orange.svg?style=flat-square)](https://alexgyver.ru/support_alex/)

Expand Down Expand Up @@ -531,6 +531,7 @@ void loop() {
- v1.19.2 - ещё немного увеличена производительность, спасибо XRay3D
- v1.19.3 - сделал высокий уровень кнопки по умолчанию в виртуальном режиме
- v1.19.4 - фикс EncButton2
- v1.20 - исправлена критическая ошибка в EncButton2

<a id="feedback"></a>
## Баги и обратная связь
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=EncButton
version=1.19.4
version=1.20
author=AlexGyver <alex@alexgyver.ru>
maintainer=AlexGyver <alex@alexgyver.ru>
sentence=Light and fast library for button and encoder operation for Arduino
Expand Down
1 change: 1 addition & 0 deletions src/EncButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
v1.19.2 - ещё немного увеличена производительность, спасибо XRay3D
v1.19.3 - сделал высокий уровень кнопки по умолчанию в виртуальном режиме
v1.19.4 - фикс EncButton2
v1.20 - исправлена критическая ошибка в EncButton2
*/

#ifndef _EncButton_h
Expand Down
4 changes: 2 additions & 2 deletions src/EncButton2.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ static const int8_t _EB_DIR[] = {
#define VIRT_ENCBTN 5
#define VIRT_ENC 6

#define EB_PIN_AM (_EB_TYPE <= 3 ? _EB_TYPE : 0)
#define EB_PIN_AM ((_EB_TYPE == EB_BTN) ? 1 : (_EB_TYPE == EB_ENCBTN ? 3 : 2))

// ===================================== CLASS =====================================
template < uint8_t _EB_TYPE, uint8_t _EB_MODE = EB_TICK >
class EncButton2 {
public:
// pinMode, pin1, pin2, pin3
EncButton2(uint8_t mode = INPUT, uint8_t P1 = 255, uint8_t P2 = 255, uint8_t P3 = 255) {
EncButton2(uint8_t mode = INPUT_PULLUP, uint8_t P1 = 255, uint8_t P2 = 255, uint8_t P3 = 255) {
setButtonLevel(_EB_TYPE <= 3 ? LOW : HIGH); // высокий уровень в виртуальном режиме
setPins(mode, P1, P2, P3);
}
Expand Down

0 comments on commit f729267

Please sign in to comment.