I have a big dot matrix lcd monitor, i can only send ascii characters via serial to it.
Therefore i need to change the datastream of the REPL to display it right.
I use a NUCLEOF401RE board.
The piece of code is my approach, and its not working, the error i got is:
"ampy.pyboard.PyboardError: ('exception', '', 'Traceback (most recent call last):\r\n File "<stdin>", line 43, in <module>\r\nOSError: stream operation not supported\r\n')"
I read the docs about dupterm, and thought this could work: https://docs.micropython.org/en/latest/ ... os.dupterm
Is it the wrong STREAM class or what am i doing wrong ?
thanks in advance, drs
Code: Select all
from pyb import UART from time import sleep import time, uos, uio uart = UART(6, 19200) class QC(uio.IOBase): def write(self, buf): print('write', repr(buf)) return len(buf) def ioctl(self): return None def read(self, nbytes): if uart.any(): return uard.read(nbytes) else: return('None') def readinto(self, buf): if uart.any(): for i in length(buf): if uart.any(): buf[i] = uard.read() else: return buf else: return(None) print('readint', repr(buf)) uos.dupterm(QC)