0

我正在尝试将串行消息从一个 nodemcu 发送到两个 arduino 板。但是,我只能使用 nodemcu 的一个 uart 引脚,即 TX 引脚。我可以毫无问题地发送消息。但是我怎样才能从另一个 uart 发送串行消息。Node mcu 文档显示它有两个 uart 引脚,分别是 TX 和 GPIO15。有人可以分享使用 GPIO15 的语法或示例吗?我附上了我用来从 TX 引脚发送消息但不知道 GPIO15 的程序。

import machine
from machine import UART
uart = UART(0) #For TX pin
uart.write("Hello \n")
4

1 回答 1

1
from machine import UART
uart = UART(1, 9600)                         # init with given baudrate
uart.init(9600, bits=8, parity=None, stop=1) # init with given parameters
uart.write("Hello \n")
于 2017-08-03T10:12:40.663 回答