From d5f5d2abbe51212c4e6ffdb98f03dab49aabe615 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Wed, 9 Mar 2022 09:05:30 -0500 Subject: removed old files which are not part of qolab package --- test_serial.py | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100755 test_serial.py (limited to 'test_serial.py') 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() -- cgit v1.2.3