# main.py -- put your code here
from machine import Pin,UART
import timeled = Pin(2,Pin.OUT)
# uart = UART(id=0, baudrate=115200,tx=1,rx=3)
# 配置串口参数
uart = UART(0, baudrate=115200)def run():led.value(1)time.sleep(2)led.value(0)time.sleep(2)def uart_send():uart.write(b'hello world')time.sleep(1)print(uart.readline())time.sleep(1)led.value(0)if __name__ == '__main__':uart_send()
使用pymakr下载(upload)后出现的是
和亮灯