xArm-Developer / xArm-Python-SDK

Python SDK for UFACTORY robots, 850, xArm5/6/7, and Lite6.
https://www.ufactory.cc
BSD 3-Clause "New" or "Revised" License
180 stars 112 forks source link

Issue with get_cgpio_digital #51

Closed tungalbert99 closed 8 months ago

tungalbert99 commented 1 year ago

Problem:

Using the function set_cgpio_digital changes the state of a cgpio pin to either high or low on the control box. Unfortunately, the corresponding getter get_cgpio_digital does not returned the changed value.

Potential Solution:

Calling arm.get_cgpio_state()[1][5] >> 9 & 0x0001 where the 9 is the correct ionum seems to work correctly after a call to set_cgpio_digital(9, 1). If get_cgpio_digital(9) is meant to not be the corresponding getter function to set_cgpio_digital(9, 1), I would advise changing the name.

vimior commented 1 year ago

@tungalbert99 Sorry to trouble you, set_cgpio_digital is to set the digital output IO of cgpio (CO0~CO7, DO0 ~ DO7), and get_cgpio_digital is to get the digital input IO of cgpio (CI0 ~ CI7, DI0 ~ DI7). Thank you for your suggestion, we will fully consider it, thank you for your support

tungalbert99 commented 1 year ago

This makes sense and matches what I'm seeing. Thank you for your quick response and constant improvements to this SDK!