gotthardp / python-mercuryapi

Python wrapper for the ThingMagic Mercury API
MIT License
122 stars 63 forks source link

reader.gpo_set(2, False) is not working. #67

Closed Jack839 closed 5 years ago

Jack839 commented 5 years ago

Here is the error: image Other function of gpio is working fine.

gotthardp commented 5 years ago

Does reader.get_gpio_outputs() include the pin you want to set?

Jack839 commented 5 years ago

When this code was ran: print("GPIO Inputs:", reader.get_gpio_inputs()) print("GPIO Outputs:", reader.get_gpio_outputs()) #reader.gpo_set(2, False) print("GPI GET:", reader.gpi_get(2)) reader.set_gpio_inputs([1, 2]) print("GPIO Inputs:", reader.get_gpio_inputs()) reader.set_gpio_outputs([3, 4]) print("GPIO Outputs:",reader.get_gpio_outputs()) Output: image

gotthardp commented 5 years ago

Looks good, or? The gpo_set shall be called after you clear the pin from gpio_inputs.

Jack839 commented 5 years ago

Will try and tell you.

Jack839 commented 5 years ago

It is working fine after doing that but is it supposed to stay stuck at that line for keeping the gpio pin high? Because code is stuck at that line and not proceeding further.

gotthardp commented 5 years ago

What is the call-stack when you interrupt the script by ctrl-c?

Jack839 commented 5 years ago

It is working fine sir. It was my mistake.