Page 1 of 1

HEBI (I/O) board getting feedback from analog/digital in python

Posted: Mon Oct 19, 2020 1:10 am
by abdulaleey
My query is related to accessing I/O board analog and digital inputs in python. I found this link but still was not able to access them in python


https://docs.hebi.us/hardware.html#io-board-feedback


I believe it should be accessible something like that

Code: Select all

fbk = hebi.GroupFeedback(group.size)
a = fbk.a1
b = fbk.e1
Or am I forgetting something?

Re: HEBI (I/O) board getting feedback from analog/digital in python

Posted: Tue Oct 20, 2020 7:06 pm
by daniel_wright
To access IO pins for both feedback and command objects, you would use the following:

Code: Select all

fbk = hebi.GroupFeedback(group.size)
a = fbk.io.a.get_int(1) # Get the int value on pin 1 bank a
b = fbk.io.e.get_int(1) # Get the int value on pin 1 bank e
To set them, you would simply do

Code: Select all

cmd.io.a.set_int(1, 2) # Set pin 1 bank a to value of 2
For future reference, our Python API reference documentation is located at https://docs.hebi.us/docs/python/2.2.1/hebi/py_api.html (2.2.1 is currently the latest version)

I hope this helps!