File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 1
1
#include "Controller.h"
2
2
#include "Device.h"
3
- #include "WheelSpeedSensor.h"
4
- #include "Utils.h"
5
3
#include "PredefinedTags.h"
4
+ #include "Utils.h"
5
+ #include "VoltageSensor.h"
6
+ #include "WheelSpeedSensor.h"
Original file line number Diff line number Diff line change
1
+ #include " VoltageSensor.h"
2
+
3
+ VoltageSensor::VoltageSensor (int *const pins) : Device<float>(pins) {}
4
+
5
+ void VoltageSensor::initialize () { pinMode (_pins[0 ], INPUT); }
6
+
7
+ float VoltageSensor::read () { return ((float ) analogRead (_pins[0 ]) / 4.092 ) % 100 / 10 ; }
Original file line number Diff line number Diff line change
1
+ #ifndef VOLTAGESENSOR_H
2
+ #define VOLTAGESENSOR_H
3
+
4
+
5
+ #include " Device.h"
6
+
7
+ class VoltageSensor : public Device <float > {
8
+ public:
9
+ WheelSpeedSensor (int *const pins);
10
+ void initialize ();
11
+ float read ();
12
+ };
13
+
14
+
15
+ #endif // VOLTAGESENSOR_H
You can’t perform that action at this time.
0 commit comments