Created
August 19, 2021 21:13
-
-
Save podstawek/048ac6782e7ae11628077c538c1951a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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