一、显示模块
![](https://img.haomeiwen.com/i23495589/05f56a057e2d6b1b.gif)
函数说明
1、microbit.display.get_pixel(x, y,value) 坐标x,y的小灯,value=0~9
2、 display.clear() 清屏
3、sleep(n) n毫秒
4、display.show("hello") #一次显示一个字母
display.scroll("hello") #一次左移一列
5、display.show(Image.HEART)
HEART HEART_SMALL HAPPY SMILE SAD SILLY CLOCK12
CLOCK1 CLOCK2 CLOCK......11
6、display.show(Image('11111:22323:33333:44444:55555'))#25个灯,不同的亮度
7、display.show(iterable, delay=400, *, wait=True, loop=False, clear=False)
举例:import microbit
microbit.display.scroll('Hello!', wait=False, loop=True)
——————
from microbit import * #举例2,点亮一个小灯,makecode和python比较
on = 9
off = 0
while 1:
display.set_pixel(0, 0, on)
sleep(500)
display.set_pixel(0, 0, off)
sleep(500)
————————
image.png
网友评论