Using RS232 I am looking to type a string into a terminal window and for the string to be echoed back to the terminal using micropython #12208
Unanswered
afrost1402
asked this question in
Using MicroPython
Replies: 1 comment 2 replies
-
And the error message you get is ... ? The question around converting bytes/bytearray pops up every week or so, e.g. in #11588. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Using RS232 I am looking to type a string into a terminal window and for the string to be echoed back to the terminal using micropython. However with the code shown below I get an error with the bytes being unable to convert to a string. Any help would be appreciated. Thanks
` from machine import UART, Pin, I2C
import utime
uart = UART(0, baudrate=9600, tx=Pin(0), rx=Pin(1))
uart.init(bits=8, parity=None, stop=2)
SDA = Pin(16)
SCL = Pin(17)
uart.write("Script Begin\n")
while True:
data = uart.read()
Beta Was this translation helpful? Give feedback.
All reactions