Created
November 22, 2014 08:57
-
-
Save projectgus/d512eb8693a930e75e4d to your computer and use it in GitHub Desktop.
Very basic scripts for logging a Reload:Pro current sweep, plotting results in GNUPlot. Could be better in many many ways.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set datafile separator comma | |
set xlabel "IOUT (mA)" | |
set ylabel "VOUT (mV)" | |
set key left bottom | |
plot \ | |
'reg_dropout_7_2v_heatsink.csv' using 2:3 with lines title 'VIN 7.2V with Heatsink', \ | |
'reg_dropout_7_2v_nohs.csv' using 2:3 with lines title 'VIN 7.2V no Heatsink', \ | |
'reg_dropout_7_5v_nohs.csv' using 2:3 with lines title 'VIN 7.5V no Heatsink', \ | |
'reg_dropout_8v_heatsink.csv' using 2:3 with lines title 'VIN 8V with Heatsink', \ | |
'reg_dropout_8v_nohs.csv' using 2:3 with lines title 'VIN 8V no Heatsink', \ | |
'reg_dropout_9v_heatsink.csv' using 2:3 with lines title 'VIN 9V with Heatsink', \ | |
'reg_dropout_9v_nohs.csv' using 2:3 with lines title 'VIN 9V no Heatsink' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python -u | |
import serial | |
import time | |
import io | |
import sys | |
port = serial.Serial('/dev/ttyUSB0', 115200, timeout=0.5) | |
port = io.TextIOWrapper(io.BufferedRWPair(port, port)) | |
port.write(u"set 0\n") | |
port.flush() | |
port.readline() | |
for setpoint in range(0,1001,10): | |
port.write(u"set %d\n" % setpoint) | |
port.flush() | |
port.readline() | |
time.sleep(0.05) | |
port.write(u"read\n") | |
port.flush() | |
resp = port.readline().split(" ") | |
print("%d,%d,%d" % (setpoint, int(resp[1]), int(resp[2]))) | |
port.write(u"set 0\n") | |
port.flush() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment