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 
28  static long int sampleTime;
29  int pin;
31  float current;
32  const char *msg;
38  void begin(int pin, const char *msg, float inSampleMax = 300);
41  static boolean checkTime();
44  void check();
45 };
46 
47 #endif
48 
static boolean checkTime()
const char * msg
float currentSampleMax
void begin(int pin, const char *msg, float inSampleMax = 300)
static long int sampleTime