BowlerKernel
Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel Class Reference
Inheritance diagram for com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel:
Inheritance graph
[legend]
Collaboration diagram for com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel:
Collaboration graph
[legend]

Public Member Functions

 AnalogInputChannel (int channel)
 
 AnalogInputChannel (DyIO dyio, int channel)
 
 AnalogInputChannel (DyIOChannel channel)
 
 AnalogInputChannel (DyIOChannel channel, boolean async)
 
double getScaledValue ()
 
double getVoltage ()
 
void setAsync (boolean isAsync)
 
void removeAllAnalogInputListeners ()
 
void removeAnalogInputListener (IAnalogInputListener l)
 
void addAnalogInputListener (IAnalogInputListener l)
 
void onChannelEvent (DyIOChannelEvent e)
 
boolean hasAsync ()
 
- Public Member Functions inherited from com.neuronrobotics.sdk.dyio.peripherals.DyIOAbstractPeripheral
 DyIOAbstractPeripheral (DyIOChannel channel, DyIOChannelMode myMode, boolean async)
 
DyIOChannelMode getClassMode ()
 
boolean isEnabled ()
 
boolean setMode ()
 
boolean setMode (boolean async)
 
boolean setMode (DyIOChannelMode mode, boolean async)
 
DyIOChannel getChannel ()
 
DyIOChannelMode getMode ()
 
boolean setValue (int value) throws InvalidResponseException
 
boolean setValue (ByteList value) throws InvalidResponseException
 
int getValue () throws InvalidResponseException
 
boolean SavePosition (int pos)
 
boolean configAdvancedAsyncNotEqual ()
 
boolean configAdvancedAsyncDeadBand (int deadbandSize)
 
boolean configAdvancedAsyncTreshhold (int threshholdValue, AsyncThreshholdEdgeType edgeType)
 
boolean configAdvancedAsyncAutoSample ()
 
boolean configAdvancedAsyncNotEqual (int msTime)
 
boolean configAdvancedAsyncDeadBand (int msTime, int deadbandSize)
 
boolean configAdvancedAsyncTreshhold (int msTime, int threshholdValue, AsyncThreshholdEdgeType edgeType)
 
boolean configAdvancedAsyncAutoSample (int msTime)
 
boolean flush ()
 
int getConfiguration ()
 

Static Public Attributes

static final int ADCRESOLUTION = 1024
 
static final int ADCVOLTAGE = 5
 

Private Member Functions

void fireValueChanged (double value)
 

Static Private Member Functions

static double scaleValue (int value)
 

Private Attributes

ArrayList< IAnalogInputListenerlisteners = new ArrayList<IAnalogInputListener>()
 

Detailed Description

The Class AnalogInputChannel.

Definition at line 30 of file AnalogInputChannel.java.

Constructor & Destructor Documentation

◆ AnalogInputChannel() [1/4]

com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.AnalogInputChannel ( int  channel)

Constructor. Creates an analog input channel that is syncronous only by default.

Parameters
channel- the channel object requested from the DyIO

Definition at line 47 of file AnalogInputChannel.java.

References com.neuronrobotics.sdk.dyio.peripherals.DyIOAbstractPeripheral.channel, com.neuronrobotics.sdk.dyio.peripherals.DyIOAbstractPeripheral.getChannel(), and com.neuronrobotics.sdk.common.DeviceManager.getSpecificDevice().

Here is the call graph for this function:

◆ AnalogInputChannel() [2/4]

com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.AnalogInputChannel ( DyIO  dyio,
int  channel 
)

Constructor. Creates an analog input channel that is syncronous only by default.

Parameters
dyiothe dyio
channel- the channel object requested from the DyIO

Definition at line 58 of file AnalogInputChannel.java.

References com.neuronrobotics.sdk.dyio.peripherals.DyIOAbstractPeripheral.channel, and com.neuronrobotics.sdk.dyio.DyIO.getChannel().

Here is the call graph for this function:

◆ AnalogInputChannel() [3/4]

com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.AnalogInputChannel ( DyIOChannel  channel)

Constructor. Creates an analog input channel that is syncronous only by default.

Parameters
channel- the channel object requested from the DyIO

Definition at line 68 of file AnalogInputChannel.java.

References com.neuronrobotics.sdk.dyio.peripherals.DyIOAbstractPeripheral.channel.

◆ AnalogInputChannel() [4/4]

com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.AnalogInputChannel ( DyIOChannel  channel,
boolean  async 
)

Constructor. Creates an analog input channel with the given ability for asyncronous communications.

Parameters
channel- the channel object requested from the DyIO
async- boolean to determine if this is an async analog channel

Definition at line 79 of file AnalogInputChannel.java.

References com.neuronrobotics.sdk.dyio.DyIOChannel.addChannelEventListener(), com.neuronrobotics.sdk.dyio.DyIOChannelMode.ANALOG_IN, com.neuronrobotics.sdk.dyio.peripherals.DyIOAbstractPeripheral.channel, com.neuronrobotics.sdk.dyio.peripherals.DyIOAbstractPeripheral.getChannel(), and com.neuronrobotics.sdk.dyio.peripherals.DyIOAbstractPeripheral.setMode().

Here is the call graph for this function:

Member Function Documentation

◆ addAnalogInputListener()

void com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.addAnalogInputListener ( IAnalogInputListener  l)

◆ fireValueChanged()

void com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.fireValueChanged ( double  value)
private

◆ getScaledValue()

double com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.getScaledValue ( )

Gets the value of the channel as a percentage.

Returns
a percent of the max voltage the is seeing

Definition at line 95 of file AnalogInputChannel.java.

References com.neuronrobotics.sdk.dyio.peripherals.DyIOAbstractPeripheral.getValue(), and com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.scaleValue().

Referenced by com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.getVoltage().

Here is the call graph for this function:

◆ getVoltage()

double com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.getVoltage ( )

Scales the value to the voltage read on the channel (between 0v and 5v).

Returns
the voltage on the pin

Definition at line 104 of file AnalogInputChannel.java.

References com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.ADCVOLTAGE, and com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.getScaledValue().

Here is the call graph for this function:

◆ hasAsync()

boolean com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.hasAsync ( )

This method is to check if this peripheral is capable to be set as up as asynchronous.

Returns
if it cna be async

Reimplemented from com.neuronrobotics.sdk.dyio.peripherals.DyIOAbstractPeripheral.

Definition at line 189 of file AnalogInputChannel.java.

◆ onChannelEvent()

void com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.onChannelEvent ( DyIOChannelEvent  e)

◆ removeAllAnalogInputListeners()

void com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.removeAllAnalogInputListeners ( )

removeAllAnalogInputListeners clears the list of async packet listeners.

Definition at line 120 of file AnalogInputChannel.java.

References com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.listeners.

Referenced by com.neuronrobotics.sdk.dyio.sequencer.ServoOutputScheduleChannel.initInput().

◆ removeAnalogInputListener()

void com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.removeAnalogInputListener ( IAnalogInputListener  l)

◆ scaleValue()

static double com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.scaleValue ( int  value)
staticprivate

Scale value.

Parameters
valuethe value
Returns
the double

Definition at line 173 of file AnalogInputChannel.java.

References com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.ADCRESOLUTION.

Referenced by com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.getScaledValue().

◆ setAsync()

void com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.setAsync ( boolean  isAsync)

Set the channel to be asyncronous or syncronous.

Parameters
isAsyncthe new async

Reimplemented from com.neuronrobotics.sdk.dyio.peripherals.DyIOAbstractPeripheral.

Definition at line 113 of file AnalogInputChannel.java.

References com.neuronrobotics.sdk.dyio.DyIOChannelMode.ANALOG_IN, and com.neuronrobotics.sdk.dyio.peripherals.DyIOAbstractPeripheral.setMode().

Referenced by com.neuronrobotics.sdk.dyio.sequencer.ServoOutputScheduleChannel.addAnalogInputListener().

Here is the call graph for this function:

Member Data Documentation

◆ ADCRESOLUTION

final int com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.ADCRESOLUTION = 1024
static

The Constant ADCRESOLUTION.

Definition at line 33 of file AnalogInputChannel.java.

Referenced by com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.scaleValue().

◆ ADCVOLTAGE

final int com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.ADCVOLTAGE = 5
static

The Constant ADCVOLTAGE.

Definition at line 36 of file AnalogInputChannel.java.

Referenced by com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.getVoltage().

◆ listeners

ArrayList<IAnalogInputListener> com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.listeners = new ArrayList<IAnalogInputListener>()
private

The documentation for this class was generated from the following file: