2023-03-27, 06:40 PM
(2023-03-26, 07:28 PM)Boatingbaileys Wrote: Interesting, I've just cleaned and complied mine and it seems to get past that stage ok. To confirm the code:
#include "sensesp/system/lambda_consumer.h"
//// Bilge Monitor /////
auto* bilge = new DigitalInputState(25, INPUT_PULLUP, 5000);
auto int_to_string_function = [](int input) ->String {
if (input == 1) {
return "Water present!";
}
else { // input == 0
return "bilge clear";
}
};
auto int_to_string_transform = new LambdaTransform<int, String>(int_to_string_function);
bilge->connect_to(int_to_string_transform)
->connect_to(new SKOutputString("propulsion.engine.bilge"));
bilge->connect_to(new SKOutputString("propulsion.engine.bilge.raw"));
Is 'input' used anywhere else on your code? I'll have another look through this tomorrow to see if I can spot anything else.
Thanks,
It seems that:
Code:
#include "sensesp/transforms/lambda_transform.h"
Code:
#include "sensesp/transforms/linear.h"
thanks for this work!