Created
November 15, 2023 04:28
-
-
Save crosstyan/22610df4676160066c085e9d84394314 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
import serial | |
with serial.Serial("/dev/ttyUSB0", 9600, timeout=0.05) as ser: | |
buf = [0xc0, 0x00, 0x08, | |
0x03, 0xea, 0x84, 0x00, 0x0f, 0x03, 0x00, 0x00] | |
ser.write(bytes(buf)) | |
r = ser.read(11) | |
print(r) | |
buf = [0xc1, 0x00, 0x08] | |
ser.write(bytes(buf)) | |
r = ser.read(11) | |
print(r) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment