logo

延时函数time库不好使,一用就报错

2021-07-29 11:03
0
_1gvc

import time

from pyb import LED

for i in range(1,5): #i = 1,2,3,4

print("LED {0} blink!".format(i))

LED(i).on() #第i个LED亮

time.sleep_ms(500) #延时500ms

LED(i).off() #第i个LED灭

time.sleep_ms(500) #延时500ms

报错:AttributeError:'module'object has no attribute 'sleep_ms'

2021-07-29 11:56
I
网红小智智 星瞳科技

升级到最新的固件。

2021-07-29 14:46
0
_1gvc

@kidswong999 耶斯莫拉,谢谢你