use v1.2.6 new operator in LCD example

This commit is contained in:
pikastech 2021-11-30 23:27:18 +08:00
parent e2b27ffb3f
commit 35acea5b3e

View File

@ -21,25 +21,18 @@ print('mem used max:')
mem.max() mem.max()
lcd.fill(x, y, w, h, 'blue') lcd.fill(x, y, w, h, 'blue')
while True: while True:
if key.get() == 0: key_val = key.get()
is_update = 1 if key_val != -1:
x_last = x x_last = x
y_last = y y_last = y
is_update = 1
if key_val == 0:
x = x + 5 x = x + 5
if key.get() == 1: if key_val == 1:
is_update = 1
x_last = x
y_last = y
y = y - 5 y = y - 5
if key.get() == 2: if key_val == 2:
is_update = 1
x_last = x
y_last = y
y = y + 5 y = y + 5
if key.get() == 3: if key_val == 3:
is_update = 1
x_last = x
y_last = y
x = x - 5 x = x - 5
if is_update: if is_update:
is_update = 0 is_update = 0