added lifecycle test
This commit is contained in:
parent
f82b31c2b5
commit
d420fae1f3
@ -1,3 +1,5 @@
|
||||
from datetime import datetime
|
||||
|
||||
import serial
|
||||
import time
|
||||
|
||||
@ -5,8 +7,8 @@ import time
|
||||
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
|
||||
datetime_format = '%Y-%m-%d %H:%M:%S'
|
||||
NUM_CYCLES = 150000
|
||||
|
||||
# Serial Connection Setup
|
||||
try:
|
||||
@ -19,10 +21,12 @@ try:
|
||||
cnt = 0
|
||||
while cnt < NUM_CYCLES:
|
||||
ser.write("fts fire\n".encode()) # Encode string to bytes for transmission
|
||||
print(f"Sent FIRE # {cnt}")
|
||||
current_time = datetime.now().strftime(datetime_format)
|
||||
print(f"{current_time} 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")
|
||||
current_time = datetime.now().strftime(datetime_format)
|
||||
print(f"{current_time} Sent RESET")
|
||||
time.sleep(1) # Wait for 1 second
|
||||
cnt+=1
|
||||
print("----------TEST FINISHED----------")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user