DCCpp
This is the library version of a program for Arduino to control railroading DCC devices.
CurrentMonitor Struct Reference

#include "CurrentMonitor.h"

Public Member Functions

void begin (int pin, const char *msg, float inSampleMax = 300)
 
void check ()
 

Static Public Member Functions

static boolean checkTime ()
 

Public Attributes

int pin
 
float currentSampleMax
 
float current
 
const char * msg
 

Static Public Attributes

static long int sampleTime =0
 

Detailed Description

This structure/class describes a current monitor.

Definition at line 27 of file CurrentMonitor.h.

Member Function Documentation

void CurrentMonitor::begin ( int  pin,
const char *  msg,
float  inSampleMax = 300 
)

begin function.

Parameters
pinAttached pin. UNEFINED_PIN to inactivate this monitor.
msgMessage to send to console when a smoothed current value grater than maximum is detected.
inSampleMaxMaximum value of the current. Default is 300.

Definition at line 16 of file CurrentMonitor.cpp.

void CurrentMonitor::check ( )

Checks the current on this monitor.

Definition at line 32 of file CurrentMonitor.cpp.

boolean CurrentMonitor::checkTime ( )
static

Checks if sufficient time has elapsed since last update. Common to all monitors.

Definition at line 24 of file CurrentMonitor.cpp.

Member Data Documentation

float CurrentMonitor::current

Value of the last measured current.

Definition at line 31 of file CurrentMonitor.h.

float CurrentMonitor::currentSampleMax

Value of the maximum current accepted without problem.

Definition at line 30 of file CurrentMonitor.h.

const char* CurrentMonitor::msg

Message to send when excessive current is measured.

Definition at line 32 of file CurrentMonitor.h.

int CurrentMonitor::pin

Attached pin.

Definition at line 29 of file CurrentMonitor.h.

long int CurrentMonitor::sampleTime =0
static

time elapsed since last measurement. This delay is common to all monitors.

Definition at line 28 of file CurrentMonitor.h.


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