Class org.bluemelon.bluesense.OCOutputDevice

Description

Class for communicating with an open collector output device.

Method Index

new OCOutputDevice()
requestSetOutput(), requestSetOutputs(), requestSetPWMDutyCycle()

Inherited from Device

Constructor Detail

OCOutputDevice

function OCOutputDevice(master:Master, deviceId:Number)

This constructor creates a new object for communicating with an open collector output 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

requestSetOutput

function requestSetOutput(side:String, gate:Number, state:Boolean)

Use this method if you want to change the state of a seperate output.

Parameters

sidecontains a string representation of the side of the board, valid are "A" and "B".
gatecontains the output number, valid are 1 through 8.
statecontains a boolean, true will turn the output on, while false will turn it off.

requestSetPWMDutyCycle

function requestSetPWMDutyCycle(side:String, gate:Number, dutyCycle:Number)

Use this method if you want to set and enable a PWM signal on an output.

Parameters

sidecontains a string representation of the side of the board, valid are "A" and "B".
gatecontains the output number, valid are 1 through 8.
dutyCyclecontains the duty cycle of the PWM signal, valid values are 0 through 255, resp. 0% to 99.9%. Note: Use 0 to turn of PWM if you want to use the requestSetOutput method.

requestSetOutputs

function requestSetOutputs(mask:Number, states:Number)

Use this method if you want to change the boolean state of a group of outputs.

Parameters

maskcontaining a 16-bit mask telling which outputs to change.
statescontaining a 16-bit value telling the new states of the outputs enable in the mask.