FlyingK - I am struggling with the ObservableVa...

I am struggling with the ObservableValue concept. I managed to get the VEDirect Input Parser up and running and I see output logged to Serial. I need to get the data not only to SignalK but also use it "locally" on the esp32 with an epaper display. I tried to create a custom FloatConsumer to log to Serial for testing and connect the consumer but I don't see anything logged.
class VoltageConsumer : public FloatConsumer {
public:
void set(const float new_value) {
debugD("Updating voltage to %f!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", new_value);
}
};
class VoltageConsumer : public FloatConsumer {
public:
void set(const float new_value) {
debugD("Updating voltage to %f!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", new_value);
}
};
and here is the call in the setup function: vedi->parser.data.channel_1_battery_voltage.connect_to(new VoltageConsumer); Any idea what's wrong or what I am missing?
2 Replies
FlyingK
FlyingK3w ago
I`ve figured it out. I didn't properly override the set function:
class VoltageConsumer : public FloatConsumer {
public:
void set(const float& new_value) override {
debugD("Updating voltage to %f!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", new_value);
}
};
class VoltageConsumer : public FloatConsumer {
public:
void set(const float& new_value) override {
debugD("Updating voltage to %f!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", new_value);
}
};
Matti Airas
Matti Airas3w ago
Good that you found it. That would've taken some time for me too...
Want results from more Discord servers?
Add your server