aboutsummaryrefslogtreecommitdiff
path: root/test_serial.py
diff options
context:
space:
mode:
Diffstat (limited to 'test_serial.py')
-rwxr-xr-xtest_serial.py47
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()