logo

为什么补光板代码和串口通信代码无法烧录, 但Hello Word和其他示例又可以烧录

2024-09-13 22:37
Y
s5xr
from pyb import Pin, Timer

# 50kHz pin6 timer2 channel1
light = Timer(2, freq=50000).channel(1, Timer.PWM, pin=Pin("P6"))
light.pulse_width_percent(100) # 控制亮度 0~100

while (True):
    time.sleep_ms(1000)
请在这里粘贴代码

通信的:

import time

from pyb import UART

uart = UART(3, 9600)

while(True):

uart.write('1234')

time.sleep(1000)//延时

if uart.any():

a=uart.readline().decode()

print(a)

2024-09-19 18:47
I
网红小智智 星瞳科技

具体的报错信息是什么?