Orocos Real-Time Toolkit  2.8.3
Public Member Functions | List of all members
RTT::dev::DigitalInput Class Reference

A class representing a switch which can be on or off. More...

#include <rtt/extras/dev/DigitalInput.hpp>

Public Member Functions

 DigitalInput (DigitalInInterface *dig_in, unsigned int bit_nr, bool invert=false)
 Create an object to read the state of a switch which can be on or off. More...
 
 DigitalInput (const bool &value, bool invert=false)
 Create an object to read the state of a boolean value which can be on or off. More...
 
 ~DigitalInput ()
 Destruct the DigitalInput. More...
 
bool isOn () const
 Status. More...
 

Detailed Description

A class representing a switch which can be on or off.

This class can be used in combination with a DigitalInInterface or as a 'virtual' switch in which case the on/off state is stored in an external boolean variable supplied to the constructor.

See also
also DigitalOutput

Definition at line 54 of file DigitalInput.hpp.

Constructor & Destructor Documentation

RTT::dev::DigitalInput::DigitalInput ( DigitalInInterface dig_in,
unsigned int  bit_nr,
bool  invert = false 
)
inline

Create an object to read the state of a switch which can be on or off.

Parameters
dig_inThe digital input device to use to read the status.
bit_nrThe bit number to use on the device.
invertSet to true to return the inverted bit in isOn().

Definition at line 65 of file DigitalInput.hpp.

RTT::dev::DigitalInput::DigitalInput ( const bool &  value,
bool  invert = false 
)
inline

Create an object to read the state of a boolean value which can be on or off.

Parameters
valueA reference to a boolean representing a digital input and which is used to read the status.
invertSet to true to return the inverted value in isOn().

Definition at line 78 of file DigitalInput.hpp.

RTT::dev::DigitalInput::~DigitalInput ( )
inline

Destruct the DigitalInput.

Definition at line 86 of file DigitalInput.hpp.

Member Function Documentation

bool RTT::dev::DigitalInput::isOn ( ) const
inline

Status.

Returns
true if the input is high.

Definition at line 93 of file DigitalInput.hpp.


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