This commit is contained in:
Kristjan Komlosi
2019-01-11 17:17:13 +01:00
parent 4771520f2b
commit 5a24d49bd0
2 changed files with 39 additions and 9 deletions
+21
View File
@@ -0,0 +1,21 @@
#main.py - the main program file of the TeraHz project
#This code is licensed under 3-clause BSD licensed
import serial as ser
#global config
# TODO: move this to another file
uartpath = '/dev/ttyUSB0'
uartbaud = 115200
uarttout = 5
print('TeraHz project')
print('Accessing the serial port')
sp = 'blank'
try:
sp = ser.Serial(uartpath, uartbaud, timeout=uarttout)
except Exception as e:
print('Connection to serial port at {} failed!'.format(uartpath))
raise e
exit()