use refresh() to refresh oled

This commit is contained in:
lyon1998 2021-10-27 22:45:17 +08:00
parent 7c195f7fdb
commit 8a2f0ba19b
3 changed files with 19 additions and 2 deletions

View File

@ -37,6 +37,10 @@ p1.x = 0
p1.y = 0
p2 = PikaPiZero.Point()
mem = PikaStdLib.MemChecker()
print('mem used max:')
mem.max()
pos = 0
isUpdate = 1
while True:
@ -66,9 +70,16 @@ while True:
oled.drawPoint(p0.x, p0.y)
oled.drawPoint(p1.x, p1.y)
oled.drawPoint(p2.x, p2.y)
oled.refresh()
if right.read() == 1:
pos = 0
isUpdate = 1
if left.read() == 0:
pos = 1
isUpdate = 1
if up.read() == 0:
pos = 2
isUpdate = 1
if down.read() == 0:
pos = 3
isUpdate = 1

View File

@ -38,5 +38,8 @@ class OLED(TinyObj):
def clear():
pass
def refresh():
pass
class Point(TinyObj):
pass

View File

@ -3,6 +3,9 @@
void PikaPiZero_OLED_drawPoint(PikaObj *self, int x, int y){
OLED_DrawPoint(x, y, 1);
}
void PikaPiZero_OLED_refresh(PikaObj *self){
OLED_Refresh();
}