LCC Fusion Project 1.0
LCC Automation
Loading...
Searching...
No Matches
Output Struct Reference

#include <Outputs.h>

Collaboration diagram for Output:

Public Member Functions

void begin (int id, int pin, int iFlag)
 
void set (int id, int pin, int iFlag)
 
void activate (int s=1)
 
bool isActivated ()
 

Static Public Member Functions

static Outputget (int id)
 
static void remove (int id)
 
static int count ()
 
static void show ()
 
static bool parse (char *c)
 
static Outputcreate (int id, int pin, int iFlag)
 

Public Attributes

struct OutputData data
 
OutputnextOutput
 

Static Public Attributes

static OutputfirstOutput =NULL
 

Detailed Description

Pins can be activated or dis-activated. The default is to set ACTIVE pins HIGH and INACTIVE pins LOW. However, this default behavior can be inverted for any pin in which case ACTIVE=LOW and INACTIVE=HIGH.

Definitions and state (ACTIVE/INACTIVE) for pins are retained in EEPROM and restored on power-up. The default is to set each defined pin to active or inactive according to its restored state. However, the default behavior can be modified so that any pin can be forced to be either active or inactive upon power-up regardless of its previous state before power-down.

To have this sketch utilize one or more Arduino pins as custom outputs, first define/edit/delete output definitions using the following variation of the "Z" command.

When controlled as such, the Arduino updates and stores the direction of each output in EEPROM so that it is retained even without power. A list of the current states of each output in the form <Y ID STATE> is generated by this sketch whenever the <s> status command is invoked. This provides an efficient way of initializing the state of any outputs being monitored or controlled by a separate interface or GUI program.

Definition at line 134 of file Outputs.h.

Member Function Documentation

◆ activate()

void Output::activate ( int  s = 1)

Change the activation state of the output. The state of the pin is updated by this function.

Parameters
snew state : see iFlag description in class description..

Definition at line 82 of file Outputs.cpp.

Here is the caller graph for this function:

◆ begin()

void Output::begin ( int  id,
int  pin,
int  iFlag 
)

Initialize the output created by regular C++ instantiation.

Parameters
idThe numeric ID (0-32767) of the output.
pinThe arduino pin number to use for the output.
iFlagDefines the operational behavior of the output based on bits 0, 1, and 2 (see in class description for values).
Remarks
Should not be used in command line mode.

Definition at line 32 of file Outputs.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ count()

int Output::count ( )
static

Get the total number of outputs.

Returns
Number of outputs.
Remarks
Only available when USE_EEPROM or USE_TEXTCOMMAND is defined.

Definition at line 148 of file Outputs.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create()

Output * Output::create ( int  id,
int  pin,
int  iFlag 
)
static

Creates a new output in the list..

Parameters
idThe numeric ID (0-32767) of the output.
pinThe arduino pin number to use for the output.
iFlagDefines the operational behavior of the output based on bits 0, 1, and 2 (see in class description for values).
Remarks
Should not be used in C++ mode.
Only available when USE_TEXTCOMMAND is defined.

Definition at line 260 of file Outputs.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get()

Output * Output::get ( int  id)
static

Get a particular output.

Parameters
idThe numeric ID (0-32767) of the output.
Returns
The found output or NULL if not found.
Remarks
Only available when USE_EEPROM or USE_TEXTCOMMAND is defined.

Definition at line 109 of file Outputs.cpp.

Here is the caller graph for this function:

◆ isActivated()

bool Output::isActivated ( )
inline

Checks if the output is activated or not.

Returns
True if the output is activated. Otherwise false (of course...).

Definition at line 158 of file Outputs.h.

◆ parse()

bool Output::parse ( char *  c)
static

Do command according to the given command string.

Parameters
cstring to interpret... See syntax in class description.
Remarks
Only available when USE_TEXTCOMMAND is defined.

Definition at line 222 of file Outputs.cpp.

Here is the call graph for this function:

◆ remove()

void Output::remove ( int  id)
static

Removes a particular output.

Parameters
idThe numeric ID (0-32767) of the output.
Remarks
Only available when USE_EEPROM or USE_TEXTCOMMAND is defined.

Definition at line 116 of file Outputs.cpp.

Here is the caller graph for this function:

◆ set()

void Output::set ( int  id,
int  pin,
int  iFlag 
)

Force the output values created by command line.

Parameters
idThe numeric ID (0-32767) of the output.
pinThe arduino pin number to use for the output.
iFlagDefines the operational behavior of the output based on bits 0, 1, and 2 (see in class description for values).
Remarks
Should not be used in C++ mode.

Definition at line 62 of file Outputs.cpp.

Here is the caller graph for this function:

◆ show()

void Output::show ( )
static

Show the content of all the outputs.

Remarks
Only available when DCCPP_PRINT_DCCPP is defined.

Definition at line 283 of file Outputs.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ data

struct OutputData Output::data

Data associated to this output.

Definition at line 135 of file Outputs.h.

◆ firstOutput

Output * Output::firstOutput =NULL
static

Address of the first object of this class. NULL means empty list of outputs. Do not change it !

Definition at line 161 of file Outputs.h.

◆ nextOutput

Output* Output::nextOutput

Address of the next object of this class. NULL means end of the list of outputs. Do not change it !

Definition at line 162 of file Outputs.h.


The documentation for this struct was generated from the following files: