From 5d2538860565ace89f2797aae46b5d060c5bd802 Mon Sep 17 00:00:00 2001 From: feurig Date: Sun, 20 Jun 2021 21:45:17 -0700 Subject: Fix keyboard logic. --- PiTerm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PiTerm.py b/PiTerm.py index cd24fb4..b35f0d7 100644 --- a/PiTerm.py +++ b/PiTerm.py @@ -44,10 +44,10 @@ while True: row_pins[r].value=0 old_row=r for c in range(12): - if (col_pins[c].value==0 and switch_state[r][c]==1): - switch_state[r][c]=0 + if (col_pins[c].value==0 and switch_state[r][c]==0): + switch_state[r][c]=1 print(keymap[r][c]) lcd.message+=keymap[r][c] - if (col_pins[c].value==1 and switch_state[r][c]==0): - switch_state[r][c]=1 + if (col_pins[c].value==1 and switch_state[r][c]==1): + switch_state[r][c]=0 time.sleep(0.01) # debounce -- cgit v1.2.3