Skip to content

Commit e75f067

Browse files
committed
Bug fixed: integer offside. (#185)
1 parent fb62491 commit e75f067

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/VoltageSensor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "VoltageSensor.h"
22

3-
VoltageSensor::VoltageSensor(int r1, int r2, int *const pins) : _factor((float) (r1 + r2) / r2), Device<float>(pins) {}
3+
VoltageSensor::VoltageSensor(float r1, float r2, int *const pins) : _factor((r1 + r2) / r2), Device<float>(pins) {}
44

55
void VoltageSensor::initialize() { pinMode(_pins[0], INPUT); }
66

src/VoltageSensor.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class VoltageSensor : public Device<float> {
88
protected:
99
float _factor;
1010
public:
11-
VoltageSensor(int r1, int r2, int *const pins);
11+
VoltageSensor(float r1, float r2, int *const pins);
1212
void initialize();
1313
float read();
1414
};

0 commit comments

Comments
 (0)