29 lines
535 B
Python
Raw Normal View History

2021-10-01 00:21:50 +08:00
import PikaStdLib
2021-10-19 08:15:01 +08:00
import STM32
import PikaPiZero
2021-10-01 00:21:50 +08:00
2021-10-26 20:08:34 +08:00
x = 0
y = 0
2021-10-25 20:16:08 +08:00
mem = PikaStdLib.MemChecker()
2021-10-01 00:21:50 +08:00
print('mem used max:')
2021-10-22 22:37:05 +08:00
mem.max()
2021-10-26 20:08:34 +08:00
oled.drawPoint(x, y)
2021-10-25 20:16:08 +08:00
while True:
if right.read() == 1:
2021-10-26 20:08:34 +08:00
if x < 15:
x = x + 1
oled.drawPoint(x, y)
if left.read() == 0:
2021-10-26 20:08:34 +08:00
if x > 0:
x = x - 1
oled.drawPoint(x, y)
if up.read() == 0:
2021-10-26 20:08:34 +08:00
if y > 0:
y = y - 1
oled.drawPoint(x, y)
if down.read() == 0:
2021-10-26 20:08:34 +08:00
if y < 7:
y = y + 1
oled.drawPoint(x, y)
2021-10-10 10:57:13 +08:00