def initialize(self):
cnt = 0
data = False
while self.flags & ServoFlags.OVERCURRENT or \
not self.flags & ServoFlags.SYNC:
self.stop()
if self.poll():
data = True
time.sleep(.001)
cnt+=1
if cnt == 400 and not data:
return False
if cnt == 1000:
return False
return True
评论列表
文章目录