TRC Library for FRC (2011) 2011
TRC Library Code Project

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.

Definition at line 73 of file AnalogIn.h.

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.

slotSpecifies the slot of the Analog Module.
channelSpecifies the Analog channel.
thresholdLoSpecifies the low threshold value of the 3 zones.
thresholdHiSpecifies the high threshold value of the 3 zones.
flagsSpecifies the flag value. For example, set the INVERSE flag will reverse the sense of high and low zones.
notifyPoints to the Notify object for AnalogIn event notification callback.

Definition at line 99 of file AnalogIn.h.

AnalogIn::~AnalogIn ( void  ) [inline]

Destructor: Destroy an instance of the AnalogIn object.

Definition at line 127 of file AnalogIn.h.

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.

Definition at line 195 of file AnalogIn.h.

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

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

fStartIf true, starts the calibration, stop the calibration otherwise.

Definition at line 162 of file AnalogIn.h.

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.

Definition at line 144 of file AnalogIn.h.

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Defines