""" Send cmd to LEDring to flash / trigger for 2 min
For using camera with VimbaViewer
IH 6/6/23
"""

import serial
import time

inttimes = [200, 50, 50, 50, 100, 300, 500, 600]

def main():
    # cam_id = parse_args() - remove this

    ENTER_KEY_CODE = 13

    i = 2 # LED i'll be flashing

    with serial.Serial('COM3', baudrate=115200, timeout=1) as ser:

        strtosend = '&{0},{1}\n\r'.format(str(i),str(inttimes[i]))
        ser.write(strtosend.encode())

        print(strtosend)
    
        time.sleep(60)

        ser.write(b'\n')

if __name__ == '__main__':
    main()