import serial
from Find_serial_ports import serial_ports
from Use_Sensors import engage_target
import logging
import time
import math

logging.basicConfig(filename='Get_sensors_test.log', format = '%(levelname)s:%(asctime)s: %(message)s', level=logging.INFO)

sensor_port = serial_ports()
sensor_port = sensor_port[0]


ser = serial.Serial(sensor_port,57600)
xyz_coord = str.split(ser.readline(),',')
xyz_coord = xyz_coord[0:9]
print(xyz_coord)
print(type(xyz_coord))

test_class = engage_target(xyz_coord)

print(test_class.target_info[4])
