mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
use refresh() to refresh oled
This commit is contained in:
parent
7c195f7fdb
commit
8a2f0ba19b
@ -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
|
||||
isUpdate = 1
|
||||
if down.read() == 0:
|
||||
pos = 3
|
||||
isUpdate = 1
|
||||
|
@ -38,5 +38,8 @@ class OLED(TinyObj):
|
||||
def clear():
|
||||
pass
|
||||
|
||||
def refresh():
|
||||
pass
|
||||
|
||||
class Point(TinyObj):
|
||||
pass
|
||||
|
@ -3,7 +3,10 @@
|
||||
|
||||
void PikaPiZero_OLED_drawPoint(PikaObj *self, int x, int y){
|
||||
OLED_DrawPoint(x, y, 1);
|
||||
OLED_Refresh();
|
||||
}
|
||||
|
||||
void PikaPiZero_OLED_refresh(PikaObj *self){
|
||||
OLED_Refresh();
|
||||
}
|
||||
|
||||
void PikaPiZero_OLED_init(PikaObj *self){
|
||||
|
Loading…
x
Reference in New Issue
Block a user