From d420fae1f31abc9b4ed2b84652fd6f3dcf27fa07 Mon Sep 17 00:00:00 2001 From: neo Date: Mon, 24 Jun 2024 18:12:03 +0200 Subject: [PATCH] added lifecycle test --- Tools/lifecycle_test.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Tools/lifecycle_test.py b/Tools/lifecycle_test.py index eb06509..0bb24ed 100644 --- a/Tools/lifecycle_test.py +++ b/Tools/lifecycle_test.py @@ -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----------")