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, int inSignalPin, const char *msg, float inSampleMax=300)
 
void check ()
 

Static Public Member Functions

static boolean checkTime ()
 

Public Attributes

int pin
 
int signalPin
 
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,
int  inSignalPin,
const char *  msg,
float  inSampleMax = 300 
)

begin function.

Parameters
pinAttached pin. UNEFINED_PIN to inactivate this monitor.
inSignalPinPin to set LOW if a shortcut is detectexd.
msgMessage to send to console when a smoothed current value greater than maximum is detected.
inSampleMaxMaximum value of the current. Default is 300 for AVR, 800 for ESP32.

Definition at line 18 of file CurrentMonitor.cpp.

void CurrentMonitor::check ( )

Checks the current on this monitor.

Definition at line 35 of file CurrentMonitor.cpp.

boolean CurrentMonitor::checkTime ( )
static

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

Definition at line 27 of file CurrentMonitor.cpp.

Member Data Documentation

float CurrentMonitor::current

Value of the last measured current.

Definition at line 32 of file CurrentMonitor.h.

float CurrentMonitor::currentSampleMax

Value of the maximum current accepted without problem.

Definition at line 31 of file CurrentMonitor.h.

const char* CurrentMonitor::msg

Message to send when excessive current is measured.

Definition at line 33 of file CurrentMonitor.h.

int CurrentMonitor::pin

Attached check 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.

int CurrentMonitor::signalPin

signal pin.

Definition at line 30 of file CurrentMonitor.h.


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