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:31:56 +08:00
|
|
|
p0 = PikaPiZero.Point()
|
|
|
|
p0.x = 0
|
|
|
|
p0.y = 0
|
|
|
|
print(p0.x)
|
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:31:56 +08:00
|
|
|
oled.drawPoint(p0.x, p0.y)
|
2021-10-25 20:16:08 +08:00
|
|
|
while True:
|
2021-10-25 22:15:50 +08:00
|
|
|
if right.read() == 1:
|
2021-10-26 20:31:56 +08:00
|
|
|
print('right')
|
|
|
|
if p0.x < 15:
|
|
|
|
p0.x = p0.x + 1
|
|
|
|
print(p0.x)
|
|
|
|
oled.drawPoint(p0.x, p0.y)
|
2021-10-25 22:15:50 +08:00
|
|
|
if left.read() == 0:
|
2021-10-26 20:31:56 +08:00
|
|
|
if p0.x > 0:
|
|
|
|
p0.x = p0.x - 1
|
|
|
|
oled.drawPoint(p0.x, p0.y)
|
2021-10-25 22:15:50 +08:00
|
|
|
if up.read() == 0:
|
2021-10-26 20:31:56 +08:00
|
|
|
if p0.y > 0:
|
|
|
|
p0.y = p0.y - 1
|
|
|
|
oled.drawPoint(p0.x, p0.y)
|
2021-10-25 22:15:50 +08:00
|
|
|
if down.read() == 0:
|
2021-10-26 20:31:56 +08:00
|
|
|
if p0.y < 7:
|
|
|
|
p0.y = p0.y + 1
|
|
|
|
oled.drawPoint(p0.x, p0.y)
|
2021-10-10 10:57:13 +08:00
|
|
|
|