Class org.bluemelon.bluesense.AdcInputDevice

Description

Class for communicating with an analogue input device.

Method Index

new AdcInputDevice()
onInputChanged(), requestSetResolution(), requestSetSampleDelay(), requestSetVoltageReference(), setTimeOutUs()

Inherited from Device

Constructor Detail

AdcInputDevice

function AdcInputDevice(master:Master, deviceId:Number)

This constructor creates a new object for communicating with an analogue input 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

onInputChanged

function onInputChanged(device:Device, input:Number, value:Number)

Whenever the value on an analogue input is changed this event will be raised.

Parameters

devicecontains a pointer back to this object, it is useful in case of single method overriding.
See Device.getDeviceId for more info.
inputtells which input is changed, it lais between 1 and 6.
valueholds the new measured value, it limits depending on the set resolution, see requestSetResolution for more info.

setTimeOutUs

function setTimeOutUs(timeOutUs:Number)

requestSetResolution

function requestSetResolution(resolution:Number)

Set the bitwise resolution of the measured values of the analog input.

Parameters

resolutionbitwise resolution from 1 to 10.

requestSetSampleDelay

function requestSetSampleDelay(sampleDelay:Number)

Set the maximum sample rate of the analog input, whenever a value is idle (eg does not change) the device will not send data.

Parameters

sampleDelaysets the minimum delay between two samples (per input) in milli seconds.

requestSetVoltageReference

function requestSetVoltageReference(voltageReference:Number)

Set the voltage to which the inputs are referenced, it can be zero to use an external source.

Parameters

voltageReferencemust be zero or between 2000 and 3300.