We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 258837b commit c2d573dCopy full SHA for c2d573d
src/VoltageSensor.cpp
@@ -4,4 +4,4 @@ VoltageSensor::VoltageSensor(int *const pins) : Device<float>(pins) {}
4
5
void VoltageSensor::initialize() { pinMode(_pins[0], INPUT); }
6
7
-float VoltageSensor::read() { return int(((float) analogRead(_pins[0]) / 4.092)) % 100 / 10; }
+float VoltageSensor::read() { return (float) analogRead(_pins[0]) * 5 / 1023; }
0 commit comments