This commit is contained in:
leca 2023-04-21 23:07:11 +03:00
parent bdc9720ca6
commit f6f94fc078
1 changed files with 11 additions and 22 deletions

View File

@ -69,36 +69,25 @@ void loop() {
screen = screen < 3? screen + 1 : 0;
}
if (increaseValue == 0 && increaseButtonLast == 1) {
if ((decreaseValue == 0 && decreaseButtonLast == 1) || increaseValue == 0 && increaseButtonLast == 1) {
switch (screen) {
case 0:
mode = 1;
mode = !mode;
break;
case 1:
address = address < 127? address + 1 : 0;
if (decreaseValue == 0 && decreaseButtonLast == 1)
address = address > 0? address - 1 : 127;
else
address = address < 127? address + 1 : 0;
break;
case 2:
key ++;
if (decreaseValue == 0 && decreaseButtonLast == 1)
key --;
else
key ++;
break;
case 3:
encryption = 1;
break;
}
}
if (decreaseValue == 0 && decreaseButtonLast == 1) {
switch (screen) {
case 0:
mode = 0;
break;
case 1:
address = address > 0? address - 1 : 127;
break;
case 2:
key --;
break;
case 3:
encryption = 0;
encryption = !encryption;
break;
}
}