#!/usr/bin/env python
import rospy

import include.io_control_lib as io


def main():
    io_cont = io.io_control()
    # Delay in seconds between state change
    delay = 0.7
    # Blink sequence
    while True:
        if io_cont.blink_enable:
            # Turn them ON
            for output in io_cont.blink_list:
                io_cont.sock.send(output + io.ON)
            rospy.sleep(delay)

            # Turn them OFF
            for output in io_cont.blink_list:
                io_cont.sock.send(output + io.OFF)
            rospy.sleep(delay)

if __name__ == '__main__':
    main()
