AnalogIn Class Reference

#include <AnalogIn.h>

List of all members.

Public Member Functions

 AnalogIn (__in UINT32 slot, __in UINT32 channel, __in INT16 thresholdLo, __in INT16 thresholdHi, __in UINT32 flags, __in AnalogInNotify *notify=NULL)
 ~AnalogIn (void)
bool IsCalibrating (void)
void Calibrate (__in bool fStart)
void AnalogInTask (void)

Detailed Description

This class defines and implements the AnalogIn object. It inherits the AnalogChannel object from the WPI library. It added the capability of detecting if the output value of an analog sensor is in one of the three zones (below the low threshold, between the low and high thresholds or above the high threshold). When the sensor value crosses into another zone, the notification object is called. The threshold values can be set in the constructor of the object or it can also be automatically determined during a calibration procedure.

Constructor & Destructor Documentation

AnalogIn::AnalogIn ( __in UINT32  slot,
__in UINT32  channel,
__in INT16  thresholdLo,
__in INT16  thresholdHi,
__in UINT32  flags,
__in AnalogInNotify notify = NULL 
) [inline]

Constructor: Create an instance of the AnalogIn object.

slot Specifies the slot of the Analog Module.
channel Specifies the Analog channel.
thresholdLo Specifies the low threshold value of the 3 zones.
thresholdHi Specifies the high threshold value of the 3 zones.
flags Specifies the flag value. For example, set the INVERSE flag will reverse the sense of high and low zones.
notify Points to the Notify object for AnalogIn event notification callback.
AnalogIn::~AnalogIn ( void   )  [inline]

Destructor: Destroy an instance of the AnalogIn object.

Member Function Documentation

void AnalogIn::AnalogInTask ( void   )  [inline]

This function is called by the robot loop to check and process AnalogIn channel triggers. It reads the value of an analog channel and compares it against the low and high thresholds. If it crosses to a different zone, the notification object is called.

void AnalogIn::Calibrate ( __in bool  fStart  )  [inline]

This function calibrates the AnalogIn channel to determine the low and high thresholds.

fStart If true, starts the calibration, stop the calibration otherwise.
bool AnalogIn::IsCalibrating ( void   )  [inline]

This function checks whether the AnalogIn channel is in calibration mode.

Returns true if the AnalogIn channel is in calibration mode, false otherwise.

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

Generated by  doxygen 1.6.2