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

Questions about our Python API
Post Reply
abdulaleey
Posts: 15
Joined: Wed Aug 26, 2020 2:52 am

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

Post by abdulaleey » Mon Oct 19, 2020 1:10 am

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?
User avatar
daniel_wright
HEBI Official
Posts: 5
Joined: Mon Mar 30, 2020 10:27 am
Location: Pittsburgh

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

Post by daniel_wright » Tue Oct 20, 2020 7:06 pm

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!
Post Reply