Mehr Debug-Infos
This commit is contained in:
parent
842b84a628
commit
6bf678cd84
30
robot.py
Executable file → Normal file
30
robot.py
Executable file → Normal file
@ -22,7 +22,7 @@ import time
|
|||||||
robot1 = Kran( 3, 5, 7, 8, 11, 10, 12, 16)
|
robot1 = Kran( 3, 5, 7, 8, 11, 10, 12, 16)
|
||||||
robot2 = Kran(40, 38, 37, 36, 35, 33, 32, 31)
|
robot2 = Kran(40, 38, 37, 36, 35, 33, 32, 31)
|
||||||
|
|
||||||
dev = InputDevice('/dev/input/event1')
|
dev = InputDevice('/dev/input/event0')
|
||||||
|
|
||||||
def robot1func(event1):
|
def robot1func(event1):
|
||||||
|
|
||||||
@ -31,20 +31,23 @@ def robot1func(event1):
|
|||||||
|
|
||||||
if event1.code == 25:
|
if event1.code == 25:
|
||||||
robot1.move("H", 1)
|
robot1.move("H", 1)
|
||||||
return 1
|
print(event.code,"H")
|
||||||
|
return 1
|
||||||
|
|
||||||
# handgelenk off
|
# handgelenk off
|
||||||
# taste ö
|
# taste ö
|
||||||
|
|
||||||
elif event1.code == 39:
|
elif event1.code == 39:
|
||||||
robot1.move("H", 2)
|
robot1.move("H", 2)
|
||||||
return 1
|
print(event.code,"H"
|
||||||
|
) return 1
|
||||||
|
|
||||||
# ellenbogen on
|
# ellenbogen on
|
||||||
# taste ü
|
# taste ü
|
||||||
|
|
||||||
elif event1.code == 26:
|
elif event1.code == 26:
|
||||||
robot1.move("E", 1)
|
robot1.move("E", 1)
|
||||||
|
print(event.code,"E")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# ellenbogen off
|
# ellenbogen off
|
||||||
@ -52,6 +55,7 @@ def robot1func(event1):
|
|||||||
|
|
||||||
elif event1.code == 40:
|
elif event1.code == 40:
|
||||||
robot1.move("E", 2)
|
robot1.move("E", 2)
|
||||||
|
print(event.code,"E")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# armgelenk on
|
# armgelenk on
|
||||||
@ -59,6 +63,7 @@ def robot1func(event1):
|
|||||||
|
|
||||||
elif event1.code == 27:
|
elif event1.code == 27:
|
||||||
robot1.move("A", 1)
|
robot1.move("A", 1)
|
||||||
|
print(event.code,"A")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# armgelenk off
|
# armgelenk off
|
||||||
@ -66,6 +71,7 @@ def robot1func(event1):
|
|||||||
|
|
||||||
elif event1.code == 43:
|
elif event1.code == 43:
|
||||||
robot1.move("A", 2)
|
robot1.move("A", 2)
|
||||||
|
print(event.code,"A")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# basis off
|
# basis off
|
||||||
@ -73,6 +79,7 @@ def robot1func(event1):
|
|||||||
|
|
||||||
elif event1.code == 52:
|
elif event1.code == 52:
|
||||||
robot1.move("B", 2)
|
robot1.move("B", 2)
|
||||||
|
print(event.code,"B")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# basis on
|
# basis on
|
||||||
@ -80,6 +87,7 @@ def robot1func(event1):
|
|||||||
|
|
||||||
elif event1.code == 53:
|
elif event1.code == 53:
|
||||||
robot1.move("B", 1)
|
robot1.move("B", 1)
|
||||||
|
print(event.code,"B")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# greifer off
|
# greifer off
|
||||||
@ -87,6 +95,7 @@ def robot1func(event1):
|
|||||||
|
|
||||||
elif event1.code == 24:
|
elif event1.code == 24:
|
||||||
robot1.move("G", 2)
|
robot1.move("G", 2)
|
||||||
|
print(event.code,"G")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# greifer on
|
# greifer on
|
||||||
@ -94,6 +103,7 @@ def robot1func(event1):
|
|||||||
|
|
||||||
elif event1.code == 38:
|
elif event1.code == 38:
|
||||||
robot1.move("G", 1)
|
robot1.move("G", 1)
|
||||||
|
print(event.code,"G")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# licht on
|
# licht on
|
||||||
@ -101,6 +111,7 @@ def robot1func(event1):
|
|||||||
|
|
||||||
elif event1.code == 51:
|
elif event1.code == 51:
|
||||||
robot1.move("L", 1)
|
robot1.move("L", 1)
|
||||||
|
print(event.code,"L")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# taste m
|
# taste m
|
||||||
@ -108,6 +119,7 @@ def robot1func(event1):
|
|||||||
elif event1.code == 50:
|
elif event1.code == 50:
|
||||||
robot1.cleanup()
|
robot1.cleanup()
|
||||||
robot2.cleanup()
|
robot2.cleanup()
|
||||||
|
print(event.code,"cleanup")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|
||||||
@ -118,6 +130,7 @@ def robot2func(event2):
|
|||||||
|
|
||||||
if event2.code == 17:
|
if event2.code == 17:
|
||||||
robot2.move("H", 1)
|
robot2.move("H", 1)
|
||||||
|
print(event.code,"H")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# handgelenk off
|
# handgelenk off
|
||||||
@ -125,6 +138,7 @@ def robot2func(event2):
|
|||||||
|
|
||||||
if event2.code == 31:
|
if event2.code == 31:
|
||||||
robot2.move("H", 2)
|
robot2.move("H", 2)
|
||||||
|
print(event.code,"H")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# ellenbogen on
|
# ellenbogen on
|
||||||
@ -132,12 +146,14 @@ def robot2func(event2):
|
|||||||
|
|
||||||
elif event2.code == 18:
|
elif event2.code == 18:
|
||||||
robot2.move("E", 1)
|
robot2.move("E", 1)
|
||||||
|
print(event.code,"E")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# ellenbogen off
|
# ellenbogen off
|
||||||
# taste d
|
# taste d
|
||||||
elif event2.code == 32:
|
elif event2.code == 32:
|
||||||
robot2.move("E", 2)
|
robot2.move("E", 2)
|
||||||
|
print(event.code,"E")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# arm on
|
# arm on
|
||||||
@ -145,6 +161,7 @@ def robot2func(event2):
|
|||||||
|
|
||||||
elif event2.code == 19:
|
elif event2.code == 19:
|
||||||
robot2.move("A", 1)
|
robot2.move("A", 1)
|
||||||
|
print(event.code,"A")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# arm off
|
# arm off
|
||||||
@ -152,6 +169,7 @@ def robot2func(event2):
|
|||||||
|
|
||||||
elif event2.code == 33:
|
elif event2.code == 33:
|
||||||
robot2.move("A", 2)
|
robot2.move("A", 2)
|
||||||
|
print(event.code,"A")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# basis off
|
# basis off
|
||||||
@ -159,6 +177,7 @@ def robot2func(event2):
|
|||||||
|
|
||||||
elif event2.code == 45:
|
elif event2.code == 45:
|
||||||
robot2.move("B", 2)
|
robot2.move("B", 2)
|
||||||
|
print(event.code,"B")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# basis on
|
# basis on
|
||||||
@ -166,6 +185,7 @@ def robot2func(event2):
|
|||||||
|
|
||||||
elif event2.code == 46:
|
elif event2.code == 46:
|
||||||
robot2.move("B", 1)
|
robot2.move("B", 1)
|
||||||
|
print(event.code,"B")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# greifer off
|
# greifer off
|
||||||
@ -173,6 +193,7 @@ def robot2func(event2):
|
|||||||
|
|
||||||
elif event2.code == 16:
|
elif event2.code == 16:
|
||||||
robot2.move("G", 2)
|
robot2.move("G", 2)
|
||||||
|
print(event.code,"G")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# greifer on
|
# greifer on
|
||||||
@ -180,6 +201,7 @@ def robot2func(event2):
|
|||||||
|
|
||||||
elif event2.code == 30:
|
elif event2.code == 30:
|
||||||
robot2.move("G", 1)
|
robot2.move("G", 1)
|
||||||
|
print(event.code,"G")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# licht on
|
# licht on
|
||||||
@ -187,12 +209,14 @@ def robot2func(event2):
|
|||||||
|
|
||||||
elif event2.code == 44:
|
elif event2.code == 44:
|
||||||
robot2.move("L", 1)
|
robot2.move("L", 1)
|
||||||
|
print(event.code,"L")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# taste v
|
# taste v
|
||||||
|
|
||||||
elif event2.code == 47:
|
elif event2.code == 47:
|
||||||
robot2.cleanup()
|
robot2.cleanup()
|
||||||
|
print(event.code,"cleanup")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user