DCCpp
This is the library version of a program for Arduino to control railroading DCC devices.
CurrentMonitor.h
1
/**********************************************************************
2
3
CurrentMonitor.h
4
COPYRIGHT (c) 2013-2016 Gregg E. Berman
5
6
Part of DCC++ BASE STATION for the Arduino
7
8
**********************************************************************/
9
10
#ifndef CurrentMonitor_h
11
#define CurrentMonitor_h
12
14
#define CURRENT_SAMPLE_SMOOTHING 0.01
15
19
#if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO) // Configuration for UNO
20
#define CURRENT_SAMPLE_TIME 10
21
#else // Configuration for MEGA
22
#define CURRENT_SAMPLE_TIME 1
23
#endif
24
27
struct
CurrentMonitor
{
28
static
long
int
sampleTime
;
29
int
pin
;
30
int
signalPin
;
31
float
currentSampleMax
;
32
float
current
;
33
const
char
*
msg
;
40
void
begin
(
int
pin
,
int
inSignalPin,
const
char
*
msg
,
float
inSampleMax
41
#
if
defined(ARDUINO_ARCH_ESP32)
42
= 800);
43
#else
44
= 300);
45
#endif
46
48
static
boolean
checkTime
();
51
void
check
();
52
};
53
54
#endif
CurrentMonitor::check
void check()
Definition:
CurrentMonitor.cpp:35
CurrentMonitor::checkTime
static boolean checkTime()
Definition:
CurrentMonitor.cpp:27
CurrentMonitor::msg
const char * msg
Definition:
CurrentMonitor.h:33
CurrentMonitor::current
float current
Definition:
CurrentMonitor.h:32
CurrentMonitor::currentSampleMax
float currentSampleMax
Definition:
CurrentMonitor.h:31
CurrentMonitor::signalPin
int signalPin
Definition:
CurrentMonitor.h:30
CurrentMonitor::pin
int pin
Definition:
CurrentMonitor.h:29
CurrentMonitor::begin
void begin(int pin, int inSignalPin, const char *msg, float inSampleMax=300)
Definition:
CurrentMonitor.cpp:18
CurrentMonitor::sampleTime
static long int sampleTime
Definition:
CurrentMonitor.h:28
CurrentMonitor
Definition:
CurrentMonitor.h:27
src
CurrentMonitor.h
Generated on dim. nov. 8 2020 16:11:48 for DCCpp by
1.3.6