Skip to content

Instantly share code, notes, and snippets.

@keichi
Last active January 23, 2023 00:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keichi/c0a64c11bee17a7127f3b8c49fe9dc2a to your computer and use it in GitHub Desktop.
Save keichi/c0a64c11bee17a7127f3b8c49fe9dc2a to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import serial # pip install pyserial
import time
def main():
with serial.Serial("/dev/ttyUSB0", 9600) as ser:
ser.write(b":TRAN:TERM 0\n")
while True:
ser.write(b":MEAS? V,A,W\n")
print(ser.readline().decode(), end="")
time.sleep(1)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment