#define CLK 5
#define DIO 6
#include <EncButton.h>
#include <GyverTM1637.h>
Button btn1(2);
Button btn2(3);
Button btn3(4);
Button btn4(7);
GyverTM1637 disp(CLK, DIO);
int a=0;
void setup() {
Serial.begin(115200); // Any baud rate should work
disp.clear(); // put your setup code here, to run once:
disp.brightness(3); // яркость, 0 - 7 (минимум - максимум)
disp.displayInt(0);
//*Serial.println("Hello Arduino\n");
// put your setup code here, to run once:
}
void loop() {
btn1.tick();
btn2.tick();
btn3.tick();
btn4.tick();
if (btn1.click()) { a=a+10; disp.displayInt(a); }
//if (btn1.press()) Serial.println("press1");
//if (btn1.hold()) Serial.println("hold1");
if (btn2.click()) { a=a-10; disp.displayInt(a); }
//if (btn2.hold()) Serial.println("hold2");
if (btn3.click()) disp.displayInt(0);
//if (btn4.press()) { a=a-10; disp.displayInt(a); }
if (btn4.release()) { a=a-10; disp.displayInt(a); }
//if (btn3.hold()) Serial.println("hold3");
// put your main code here, to run repeatedly:
}