2019-10-21 08:06:37 +02:00
|
|
|
#include "Wire.h"
|
|
|
|
#include "Arduino.h"
|
|
|
|
#include "HardwareSerial.h"
|
2019-10-21 08:57:58 +02:00
|
|
|
#include "vars.h"
|
2019-10-21 08:06:37 +02:00
|
|
|
|
|
|
|
class DataSource {
|
2019-10-21 08:57:58 +02:00
|
|
|
|
2019-10-21 08:06:37 +02:00
|
|
|
public:
|
2019-10-21 08:57:58 +02:00
|
|
|
DataSource();
|
|
|
|
DataSource(HardwareSerial, int);
|
|
|
|
DataSource(TwoWire);
|
|
|
|
DataSource(int, bool);
|
|
|
|
|
2019-10-21 08:06:37 +02:00
|
|
|
public:
|
|
|
|
void update();
|
|
|
|
void test();
|
2019-10-21 08:57:58 +02:00
|
|
|
void readSensor();
|
2019-10-21 08:06:37 +02:00
|
|
|
void postProcess();
|
|
|
|
int getValue();
|
|
|
|
|
2019-10-21 08:57:58 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
HardwareSerial* ser;
|
|
|
|
TwoWire* i2c;
|
|
|
|
|
|
|
|
int pin;
|
|
|
|
int protocol;
|
|
|
|
int value;
|
|
|
|
|
|
|
|
|
2019-10-21 08:06:37 +02:00
|
|
|
};
|