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):
8383 if self .check_is_simulation_robot ():
8484 return 0 , [0 , 0 ] if ionum is None else 0
8585 if ionum == 2 :
86- # only available in Lite6
86+ # Only available for Lite6 and 850
8787 ret = self .arm_cmd .tgpio_addr_r16 (0x0A12 )
8888 return ret [0 ], ret [1 ] & 0x0001
89- elif isinstance ( ionum , int ) :
89+ else :
9090 ret = self .arm_cmd .tgpio_get_digital ()
9191 if ret [0 ] == 0 :
9292 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 ]
10194
10295 @xarm_is_connected (_type = 'get' )
10396 def get_tgpio_output_digital (self , ionum = None ):
You can’t perform that action at this time.
0 commit comments