SHARE
TWEET

Untitled

a guest Jan 21st, 2020 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. UART.setup("UART1")
  2. with serial.Serial(port = "/dev/ttyO1", baudrate=9600) as ser:
  3.    print("Serial is open!")
  4.    msg = ''
  5.    while True:
  6.        data = ser.read().decode("ascii")
  7.        msg += str(data)
  8.  
  9.        if data == '\n':
  10.            print(msg, end='')
  11.            msg = ''
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top