-
Notifications
You must be signed in to change notification settings - Fork 0
/
CurrentMonitor.h
48 lines (36 loc) · 1.06 KB
/
CurrentMonitor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**********************************************************************
CurrentMonitor.h
COPYRIGHT (c) 2013-2016 Gregg E. Berman
Part of DCC++ BASE STATION for the Arduino
**********************************************************************/
#ifndef CurrentMonitor_h
#define CurrentMonitor_h
#include "Arduino.h"
#define CURRENT_SAMPLE_SMOOTHING 0.01
#define CURRENT_SAMPLE_MAX_PROG 96 // ~4A
#ifdef ARDUINO_AVR_UNO // Configuration for UNO
#define CURRENT_SAMPLE_TIME 10
#else // Configuration for MEGA
#define CURRENT_SAMPLE_TIME 1
#endif
extern int PinCounter;
extern int pins[];
extern int Apins[];
extern void SendExtInfo(byte outAddr, byte outValue);
struct CurrentMonitor{
static long int sampleTime;
int pin;
int Apin;
float current;
float MaxCurrent;
char *msg;
CurrentMonitor(int, int, int, char *);
static boolean checkTime();
void check();
int Counter;
void Power(bool);
void Reset();
void PowerAll(bool);
int CalcTotalCurrent();
};
#endif