File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -83,21 +83,14 @@ def get_tgpio_digital(self, ionum=None):
83
83
if self .check_is_simulation_robot ():
84
84
return 0 , [0 , 0 ] if ionum is None else 0
85
85
if ionum == 2 :
86
- # only available in Lite6
86
+ # Only available for Lite6 and 850
87
87
ret = self .arm_cmd .tgpio_addr_r16 (0x0A12 )
88
88
return ret [0 ], ret [1 ] & 0x0001
89
- elif isinstance ( ionum , int ) :
89
+ else :
90
90
ret = self .arm_cmd .tgpio_get_digital ()
91
91
if ret [0 ] == 0 :
92
92
self .tgpio_state ['digital' ] = ret [1 :]
93
- return ret [0 ], ret [ionum + 1 if ionum < 3 else ionum ]
94
- else :
95
- ret1 = self .arm_cmd .tgpio_addr_r16 (0x0A12 )
96
- ret2 = self .arm_cmd .tgpio_get_digital ()
97
- if ret2 [0 ] == 0 :
98
- self .tgpio_state ['digital' ] = ret2 [1 :]
99
- ret2 .insert (3 , ret1 [1 ])
100
- return ret1 [0 ] or ret2 [0 ], ret2 [1 :]
93
+ return ret [0 ], ret [1 :] if ionum is None else ret [ionum + 1 if ionum < 3 else ionum ]
101
94
102
95
@xarm_is_connected (_type = 'get' )
103
96
def get_tgpio_output_digital (self , ionum = None ):
You can’t perform that action at this time.
0 commit comments