Nick Ryder / IrcBot Featured
Embed: (wiki syntax)

« Back to documentation index

AnalogInHandler Class Reference

AnalogInHandler Class Reference

AnalogInHandler lets users read a DigitalIn using "READ <name>". More...

#include <IrcMessageHandlers.h>

Inherits MessageHandler.

Public Member Functions

 AnalogInHandler (char *name, PinName pin)
 Create an AnalogInHandler.
void scale (float scale, char *unit)
 Define a scaling factor for the measured value [0.0 - 1.0].
IrcMessage handle (IrcMessage)
 Measure input, scale and reply "<name> = <value> <units>".

Detailed Description

AnalogInHandler lets users read a DigitalIn using "READ <name>".

Definition at line 38 of file IrcMessageHandlers.h.


Constructor & Destructor Documentation

AnalogInHandler ( char *  name,
PinName  pin 
)

Create an AnalogInHandler.

Parameters:
nameName of input used in command on IRC
pinPin the input is connected to.

Definition at line 69 of file IrcMessageHandlers.cpp.


Member Function Documentation

IrcMessage handle ( IrcMessage  msg ) [virtual]

Measure input, scale and reply "<name> = <value> <units>".

Reimplemented from MessageHandler.

Definition at line 81 of file IrcMessageHandlers.cpp.

void scale ( float  scale,
char *  unit 
)

Define a scaling factor for the measured value [0.0 - 1.0].

Parameters:
scaleThe scaling factor
unitThe units used in the message to IRC

Definition at line 76 of file IrcMessageHandlers.cpp.