Class org.bluemelon.bluesense.ServoDevice

Description

Class for communicating with a servo controller device.

Method Index

new ServoDevice()
requestSetAngle(), requestSetConfiguration()

Inherited from Device

Constructor Detail

ServoDevice

function ServoDevice(master:Master, deviceId:Number)

This constructor creates a new object for communicating with a servo controller device.

Parameters

mastercontains a pointer to the master object, see Master.
deviceIdis the unique device identifier which you can find on the board or using the Master.requestDeviceTable method of the Master.

Method Detail

requestSetAngle

function requestSetAngle(port:Number, angle:Number)

Change the angle of a servo motor.

Parameters

portspecifies the port of which the pulse width has to be changed, valid are 1 through 8.
anglespecifies the angle it should be between 0 and 255, for most servos this means 0 to 180 degrees.

requestSetConfiguration

function requestSetConfiguration(offset:Number)

Change the configuration of a servo controller.

Parameters

offsetspecifies how much the pulse width should be offset, use it to calibrate the device to match a certain servo motor.