Page 1 of 1

PhidgetAdvancedServo: Accessing individual motors

Posted: Wed Sep 26, 2012 2:44 pm
by digitalmatt
I'm using the 1061 to control several different linear actuators. I've written a class that I'd like to instantiate for each actuator attached to the 1061 so that I can more flexibly control them separately. The problem I'm having is that there doesn't seem to be a native way to tie methods of the PhidgetAdvancedServo class to my custom class. What I'd like to do is pass each motor and its different states to the class as an object. I feel like POSITION_CHANGE should be an event tied to the actuator, not the controller. So that I don't have to do something like

Code: Select all

PhidgetAdvancedServo.setPosition(motorIndex, 0)


but instead

Code: Select all

PhidgetAdvancedServo.servo[motorIndex].setPosition(0)


Does anyone have any experience doing something like this? How would I approach it? Hope this is clear.

Re: PhidgetAdvancedServo: Accessing individual motors

Posted: Wed Oct 03, 2012 9:46 am
by digitalmatt
*bump*

Re: PhidgetAdvancedServo: Accessing individual motors

Posted: Thu Oct 04, 2012 10:11 am
by Patrick
You will always need the parent object which controls access to the board and opens it - but after this, you can implement your own interfaces as you like.

-Patrick