SPQR-Team1-2020/include/data_source.h

41 lines
708 B
C
Raw Normal View History

#pragma once
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();
2019-11-18 14:42:43 +01:00
DataSource(usb_serial_class, int);
2019-10-21 08:57:58 +02:00
DataSource(TwoWire);
DataSource(int, bool);
2019-10-21 08:06:37 +02:00
public:
2019-11-18 14:37:55 +01:00
virtual void update();
virtual void test();
virtual void readSensor();
virtual void postProcess();
virtual int getValue();
2019-10-21 08:06:37 +02:00
2019-10-21 08:57:58 +02:00
public:
2019-11-18 14:37:55 +01:00
enum Protocols {
P_I2C,
P_RXTX,
P_APIN,
P_PIND
};
2019-11-18 14:42:43 +01:00
usb_serial_class* ser;
2019-10-21 08:57:58 +02:00
TwoWire* i2c;
int pin;
int protocol;
int value;
2019-11-18 14:37:55 +01:00
2019-10-21 08:06:37 +02:00
};