added lifecycle test
This commit is contained in:
parent
f3d674c7df
commit
f82b31c2b5
30
Tools/lifecycle_test.py
Normal file
30
Tools/lifecycle_test.py
Normal file
@ -0,0 +1,30 @@
|
||||
import serial
|
||||
import time
|
||||
|
||||
# Serial Port Configuration
|
||||
port = '/dev/ttyUSB0' # Replace with your actual serial port (e.g., 'COM3' on Windows)
|
||||
baudrate = 57600 # Replace with your desired baud rate
|
||||
timeout = 1 # Optional timeout for read operations (in seconds)
|
||||
|
||||
NUM_CYCLES = 100000
|
||||
|
||||
# Serial Connection Setup
|
||||
try:
|
||||
ser = serial.Serial(port, baudrate, timeout=timeout)
|
||||
print(f"Connected to serial port: {port}")
|
||||
|
||||
ser.write("fts arm\n".encode()) # Encode string to bytes for transmission
|
||||
print(f"Sent ARM")
|
||||
|
||||
cnt = 0
|
||||
while cnt < NUM_CYCLES:
|
||||
ser.write("fts fire\n".encode()) # Encode string to bytes for transmission
|
||||
print(f"Sent FIRE # {cnt}")
|
||||
time.sleep(1) # Wait for 1 second
|
||||
ser.write("fts reset\n".encode()) # Encode string to bytes for transmission
|
||||
print(f"Sent RESET")
|
||||
time.sleep(1) # Wait for 1 second
|
||||
cnt+=1
|
||||
print("----------TEST FINISHED----------")
|
||||
except serial.SerialException as e:
|
||||
print(f"Error opening serial port: {e}")
|
||||
Loading…
Reference in New Issue
Block a user