Last active
January 23, 2023 00:14
-
-
Save keichi/c0a64c11bee17a7127f3b8c49fe9dc2a to your computer and use it in GitHub Desktop.
This file contains 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/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