Compare commits

..

2 Commits

Author SHA1 Message Date
interfisch d0f82299c0 add python serial write script 2022-02-13 13:00:19 +01:00
interfisch 5286466d2c move ino to arduino project folder 2022-02-13 12:48:00 +01:00
2 changed files with 31 additions and 0 deletions

31
tools/serialtype.py Normal file
View File

@ -0,0 +1,31 @@
#! /usr/bin/env python3
import serial
#chars=" qwertzuiopü+asdfghjklöä#yxcvbnm,.-QWERTZUIOPÜ*ASDFGHJKLÖÄ'YXCVBNM;:_1234567890ß!\"§$%&/()=?"
chars=" qwertzuiop+asdfghjklöä#yxcvbnm,.-QWERTZUIOP*ASDFGHJKLÖÄ'YXCVBNM;:_1234567890ß!\"§$%&/()=?"
#asciiresolution_max=[97,65] #maximum, in characters xy. Teilung=15
#asciiresolution_max=[78,65] #maximum, in characters xy. Teilung=12
asciiresolution_max=[65,30] #maximum, in characters xy. Teilung=10
def main():
import sys
if len(sys.argv) != 2:
print("Usage: serialtype filename")
sys.exit(1)
filename=sys.argv[1]
with serial.Serial('/dev/ttyUSB0', 9200, timeout=1) as ser:
ser.write(b'test')
ser.write(b'\n')
ser.write(b'zeile2')
if __name__ == "__main__":
main()