Initial test

This commit is contained in:
Aries Wibowo
2026-04-22 09:19:12 +07:00
parent 9abcfe6bb8
commit 484ba05a65
131 changed files with 65583 additions and 0 deletions

36
serialConnect.py Normal file
View File

@@ -0,0 +1,36 @@
import serial
ser = serial.Serial('/dev/ttyACM0', 115200, timeout=1)
if ser:
print("Terhubung!")
else:
print("Gagal terhubung.")
#ser.write(b'\r\n')
#response = ser.read(100)
#print("Response:", response.decode(errors='ignore'))
#ser.write(bytes.fromhex('02 00 00 00 00 00 00 03'))
#response = ser.read(100)
#print("Response:", response.hex())
#while True:
# data = ser.readline()
# if data:
# print("Received:", data.decode(errors='ignore'))
#ser.write(b'~RS\n') # Try Reset
ser.write(b'~VER\n') # Try Version
ser.write(b'~ID\n') # Try Device ID
response = ser.read(100)
print("Response:", response.decode(errors='ignore'))
#ser.write(b'INFO\n')
#ser.write(b'PING\n')
##response = ser.read(100)
#print(response.decode('utf-8'))
#ser.write(b'RESET\n') # Kirim perintah reset
#response = ser.read(100) # Baca respons dari mesin
#print(response.decode('utf-8'))
ser.close()