-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAnalogSensor.h
47 lines (34 loc) · 827 Bytes
/
AnalogSensor.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
/**
AnalogSensor - class describes
a set of methods for working with an analog sensor.
Instantiation:
Sensor* analogSensor = new AnalogSensor(A1);
Read signal:
int value = sensor->read();
v.1.3.3
- updated documentation
https://github.com/YuriiSalimov/AD_Sensors
Created by Yurii Salimov, May, 2018.
Released into the public domain.
*/
#ifndef ANALOG_SENSOR_H
#define ANALOG_SENSOR_H
#include "Sensor.h"
class AnalogSensor final : public Sensor {
private:
int pin;
public:
/**
Constructor
@param pin - an analog port number
that is attached to the sensor
*/
AnalogSensor(int pin);
/**
Reads and return a signal from the analog sensor,
from an analog port.
@return the analog sensor signal.
*/
int read() override;
};
#endif