Close

Added Newline to Serial Send

A project log for SD/Serial Card Loader

Load/Save files from/to an SD card to/from a Serial Port

land-boards.comland-boards.com 06/15/2022 at 18:410 Comments

The serial send routine (readPrintFileLines(pathFileName)) reads a line at a time and strips off the newline. It would be a good addition as an option but since I'm only handling ASCII serial data at the moment I added it back in.

# readPrintFileLines() Dump file to USB serial
def readPrintFileLines(pathFileName):
    global uart
    with open(pathFileName, "r") as f:
        for line in f:
            if serialDebug:
                print(line, end='')
            uart.write(bytes(line, 'utf-8'))
        uart.write(bytes('\r', 'utf-8'))

 Grabbed data using an FTDI card

Dumped a file to TeraTerm connected to the FTDI card. 

Looks good.

Discussions