DCCpp
This is the library version of a program for Arduino to control railroading DCC devices.
Sensor.h
1
/**********************************************************************
2
3
Sensor.h
4
COPYRIGHT (c) 2013-2016 Gregg E. Berman
5
6
Part of DCC++ BASE STATION for the Arduino
7
8
**********************************************************************/
9
10
#ifndef Sensor_h
11
#define Sensor_h
12
13
#ifdef ARDUINO_ARCH_AVR
14
#include "Arduino.h"
15
16
#include "
DCCpp.h
"
17
#ifdef USE_SENSOR
18
19
#define SENSOR_DECAY 0.03
20
22
struct
SensorData {
23
int
snum;
24
byte pin;
25
byte pullUp;
26
};
27
116
struct
Sensor{
117
static
Sensor *firstSensor;
118
SensorData data;
119
boolean
active;
120
float
signal;
121
Sensor *nextSensor;
129
void
begin(
int
snum,
int
pin,
int
pullUp);
136
void
set
(
int
snum,
int
pin,
int
pullUp);
142
static
Sensor*
get
(
int
snum);
147
static
void
remove
(
int
snum);
152
static
int
count();
155
static
void
check();
159
boolean
isActive() {
return
this->active; }
160
161
#ifdef DCCPP_PRINT_DCCPP
162
165
static
void
show();
169
static
void
status();
170
#endif
171
172
#ifdef USE_EEPROM
173
176
static
void
load();
180
static
void
store();
181
#endif
182
183
#if defined(USE_TEXTCOMMAND)
184
188
static
void
parse(
char
*c);
196
static
Sensor *create(
int
snum,
int
pin,
int
pullUp);
197
#endif
198
};
// Sensor
199
200
#endif
201
202
#endif
203
#endif
DCCpp.h
src
Sensor.h
Generated on lun. juin 10 2019 17:03:43 for DCCpp by
1.2.10