3-3:移动的箭头

课程难度

⭐⭐⭐

课程任务

开机后,箭头从下向上移动,不断重复此效果,向上剪头由3个像素点组成。

效果展示

代码

from microbit import *
while True:
    for i in range(5):
        display.set_pixel(1, 4-i, 9)
        if i < 4:
            display.set_pixel(2, 3-i, 9)
        else:
            display.set_pixel(2, 4, 9)
        display.set_pixel(3, 4-i, 9)
        sleep(200)
        display.clear()

发表评论

您的邮箱地址不会被公开。 必填项已用 * 标注

Scroll to Top