mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-30 03:26:13 +01:00
e0c76a9dc4
In prep for Wifi siolution, all output functions changed to expect Print class instead of Stream... Can still pass Serial1 etc because Stream extends Print, but this allows for an output-only class extending Print to collect a response buffer for Wifi sending with AT commands.
31 lines
553 B
C
31 lines
553 B
C
#ifndef Sensor_h
|
|
#define Sensor_h
|
|
|
|
#include "Arduino.h"
|
|
|
|
#define SENSOR_DECAY 0.03
|
|
|
|
struct SensorData {
|
|
int snum;
|
|
uint8_t pin;
|
|
uint8_t pullUp;
|
|
};
|
|
|
|
struct Sensor{
|
|
static Sensor *firstSensor;
|
|
SensorData data;
|
|
boolean active;
|
|
float signal;
|
|
Sensor *nextSensor;
|
|
static void load();
|
|
static void store();
|
|
static Sensor *create(int, int, int);
|
|
static Sensor* get(int);
|
|
static bool remove(int);
|
|
static void show(Print & stream);
|
|
static void status(Print & stream);
|
|
static void check(Print & stream);
|
|
}; // Sensor
|
|
|
|
#endif
|