예제 #1
0
def retry_open_port():
    for i in range(config.OPEN_PORT_RETRY):
        try:
            T = tracker.comm(config.COMM_PORT)
        except:
            T = -1
        else:
            return T
        print("comm port open failed, retry#%d"%i)
        time.sleep(config.OPEN_PORT_RETRY_INTERVAL)
    return -1
예제 #2
0
파일: aa.py 프로젝트: kanawat/SolarTracker
import sys

sys.path.append("G:\\Solar_PyLib")
import tracker

T = tracker.comm("COM9")
T.enable_comm(3)
T.move_actuator_west(3, 0, 500)
for i in range(20):
    T.get_actuator_len(3)
    T.enable_comm(3)
del T