Skip to content

Instantly share code, notes, and snippets.

@podstawek
Created August 19, 2021 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save podstawek/048ac6782e7ae11628077c538c1951a9 to your computer and use it in GitHub Desktop.
Save podstawek/048ac6782e7ae11628077c538c1951a9 to your computer and use it in GitHub Desktop.
import serial
import sys
ourSerial = serial.Serial()
ourSerial.port = '/dev/ttySC1'
ourSerial.baudrate = 4800
ourSerial.bytesize = serial.EIGHTBITS
ourSerial.parity = serial.PARITY_NONE
ourSerial.stopbits = serial.STOPBITS_ONE
ourSerial.xonxoff = False
ourSerial.rtscts = False
ourSerial.dsrdtr = False
ourSerial.open()
ourSerial.flushInput()
ourSerial.flushOutput()
with open (sys.argv[1]) as fil:
count = 1
for li in fil:
ourSerial.write(li)
ourSerial.flush()
count += 1
fil.close()
print str(count) + " lines written to Motorola ECB."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment