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 e5d3199 commit 6a82e77Copy full SHA for 6a82e77
src/components/analogIO/controller.cpp
@@ -151,12 +151,15 @@ void AnalogIOController::update() {
151
if (pin.read_mode == wippersnapper_sensor_SensorType_SENSOR_TYPE_RAW) {
152
// Since we already read the raw value, encode and publish it to the
153
// broker
154
- // TODO
+ EncodePublishPinValue(pin.name, value);
155
} else if (pin.read_mode ==
156
wippersnapper_sensor_SensorType_SENSOR_TYPE_VOLTAGE) {
157
// Convert the raw value into voltage
158
float pin_value = _analogio_hardware->CalculatePinVoltage(value);
159
// Encode and publish the voltage value to the broker
160
+ EncodePublishPinVoltage(pin.name, pin_value);
161
+ } else {
162
+ WS_DEBUG_PRINTLN("ERROR: Invalid read mode for analog pin!");
163
}
164
165
0 commit comments