PhidgetAdvancedServo: Accessing individual motors

Legacy support with Phidget21
digitalmatt
Phidgetsian
Posts: 12
Joined: Wed Jul 25, 2012 1:24 pm
Contact:

PhidgetAdvancedServo: Accessing individual motors

Postby digitalmatt » Wed Sep 26, 2012 2:44 pm

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.

digitalmatt
Phidgetsian
Posts: 12
Joined: Wed Jul 25, 2012 1:24 pm
Contact:

Re: PhidgetAdvancedServo: Accessing individual motors

Postby digitalmatt » Wed Oct 03, 2012 9:46 am

*bump*

User avatar
Patrick
Lead Developer
Posts: 3078
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: PhidgetAdvancedServo: Accessing individual motors

Postby Patrick » Thu Oct 04, 2012 10:11 am

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


Return to “ActionScript 3.0 - Flash CS3 / Flex / AIR”

Who is online

Users browsing this forum: No registered users and 0 guests