added flushInput before sending next command to avoid buffer full of READY
This commit is contained in:
parent
024c0ff9e3
commit
5adcaf6239
13
demSequence.py
Normal file
13
demSequence.py
Normal file
@ -0,0 +1,13 @@
|
||||
import meControll
|
||||
|
||||
arm = meControll.meArm()
|
||||
|
||||
pickupLeft = [b'S1', b'T130', b'R110', b'L50', b'R150',b'G170', b'R110' ]
|
||||
drop_right = [b'S1', b'T50', b'R150', b'G90', b'R100', b'D1']
|
||||
|
||||
arm.addMove(pickupLeft)
|
||||
arm.addMove(drop_right)
|
||||
arm.execMove(0)
|
||||
arm.execMove(1)
|
||||
|
||||
|
@ -22,6 +22,7 @@ class meArm:
|
||||
[print(i, x) for i, x in enumerate(self.moves)]
|
||||
|
||||
def sendCmd(self, cmd = b'H1'):
|
||||
self.ser.flushInput() #Last change. if broken remove this
|
||||
while(1):
|
||||
line = self.ser.readline()
|
||||
# print(f"sendCmd: {line}")
|
||||
@ -53,6 +54,25 @@ class meArm:
|
||||
c+=1
|
||||
if c ==2: break
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
x
Reference in New Issue
Block a user