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 
13 //#include "Arduino.h"
14 
15 #define CURRENT_SAMPLE_SMOOTHING 0.01
16 
17 #if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO) // Configuration for UNO
18  #define CURRENT_SAMPLE_TIME 10
19 #else // Configuration for MEGA
20  #define CURRENT_SAMPLE_TIME 1
21 #endif
22 
24  static long int sampleTime;
25  int pin;
26  float currentSampleMax;
27  float current;
28  const char *msg;
29  void begin(int, const char *, float = 300);
30  static boolean checkTime();
31  void check();
32 };
33 
34 #endif
35