import serial
import time

# Configure the serial port
COM_PORT = "COM8"  # Change this to your actual COM port
BAUD_RATE = 115200  # Adjust according to your setup

# Open the serial port
ser = serial.Serial(COM_PORT, BAUD_RATE, timeout=1)
# Wait for the port to initialize
time.sleep(2)

tries = 1000
while(tries):
    tries -= 1

    # Data to send (8 characters)
    data = "abcdefgh"

    # Send data
    ser.write(data.encode())

    print(f"Sent: {data}")
    time.sleep(1)

# Close the port
ser.close() 