import sys, serial, time


def main():
    port = "/dev/ttyACM0"
    connection = serial.Serial(port, 115200)

    # first, send "SCIP2.0" when sensor type is URG-04LX
    connection.write("SCIP2.0\n")
    time.sleep(0.1)

    # display sensor version.
    connection.write("VV\n")
    while True:
        data = connection.read(1)
        sys.stdout.write(data)
        time.sleep(0.000)


if __name__ == '__main__':
    main()
