diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-03-09 09:05:30 -0500 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-03-09 09:05:30 -0500 |
commit | d5f5d2abbe51212c4e6ffdb98f03dab49aabe615 (patch) | |
tree | 433ebf194aa1cbccd847be44534b72c45ce63cb0 /test_serial.py | |
parent | 537967dc5a2101ae54c4b161cf8ef1abeaa499e6 (diff) | |
download | qolab-d5f5d2abbe51212c4e6ffdb98f03dab49aabe615.tar.gz qolab-d5f5d2abbe51212c4e6ffdb98f03dab49aabe615.zip |
removed old files which are not part of qolab package
Diffstat (limited to 'test_serial.py')
-rwxr-xr-x | test_serial.py | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/test_serial.py b/test_serial.py deleted file mode 100755 index f88302b..0000000 --- a/test_serial.py +++ /dev/null @@ -1,47 +0,0 @@ -import serial
-import io
-
-import time # For sleep, clock, time and perf_counter
-from datetime import datetime, timedelta
-
-# ser = serial.Serial('COM4', 115200, timeout=1)
-ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=1)
-# ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=1)
-
-# ser.write(b'dofile("bits_converging.lua")\r')
-# ser.write(b'dofile("microwire.lua")\r')
-# ser.write(b'dofile("lmx2487lib.lua")\r')
-# ser.write(b'dofile("Frequency_Settings.lua")\r')
-
-# ser.write(b'settings = initSettings()\r')
-# ser.write(b'settings = set_lmx2487_to_Frequency (startfreq, settings)\r')
-
-
-
-def sendSerialCmd(cmd):
- # start = datetime.now()
- ser.write(bytes(cmd+'\r','ascii'))
- resp = ser.read_until(terminator=b'> ')
- resp = resp.decode('utf-8')
- # print(resp)
- # stop = datetime.now()
- # runTime = (stop-start).seconds + float((stop-start).microseconds)/1000000
- # print("Command: " + cmd + " runtime %s seconds." % (runTime) )
- return resp
-
-sendSerialCmd("print(2+3)")
-
-line = ser.readline()
-print(line)
-
-start = datetime.now()
-# resp = sendSerialCmd("print(node.heap())")
-# resp = sendSerialCmd(""); # empty command
-resp = sendSerialCmd("muSb= tmr.now(); setFreq(6.834e9); muSe =tmr.now(); print(\"execution time: \" .. muSe-muSb .. \" muS\")")
-print(resp)
-stop = datetime.now()
-runTime = (stop-start).seconds + float((stop-start).microseconds)/1000000
-print("runtime %s seconds." % (runTime) )
-
-
-ser.close()
|