Optimize code

master
rdagger 5 years ago
parent 767e9a93d4
commit 357dba06dc

@ -100,7 +100,7 @@ def main():
spi2 = SPI(2, baudrate=1000000,
sck=Pin(18), mosi=Pin(23), miso=Pin(19))
pwn = PwnLookup(spi1, spi2)
PwnLookup(spi1, spi2)
while True:
sleep(.1)

@ -29,7 +29,7 @@ class TouchKeyboard(object):
(
('1', '2', '3', '4', '5', '6', '7', '8', '9', '0'),
('<', '>', '|', '\\', '/', '{', '}', '[', ']'),
('\v', '=', '"', '\'', ';', ':', '`', '~', '\b', '\b'),
('\f', '=', '"', '\'', ';', ':', '`', '~', '\b', '\b'),
('\a', ' ', '\r')
)
)
@ -97,10 +97,7 @@ class TouchKeyboard(object):
self.kb_screen ^= 1 # Toggle caps
self.load_keyboard()
elif key == '\f':
self.kb_screen = 3 # Symbols Set 2
self.load_keyboard()
elif key == '\v':
self.kb_screen = 2 # Symbols Set 1
self.kb_screen = self.kb_screen - 2 ^ 1 + 2 # Toggle symbols
self.load_keyboard()
elif key == '\a':
self.kb_screen = 0 # Letters

@ -99,7 +99,6 @@ class Touch(object):
elif pin.value() and self.int_locked:
sleep(.1) # Debounce rising edge
self.int_locked = False # Unlock interrupt
return
def normalize(self, x, y):
"""Normalize mean X,Y values to match LCD screen."""

Loading…
Cancel
Save