2021-07-23, 08:38 PM
Hi there,
Using the ESP32 capacitive touch capabilities to read tank levels is a brilliant idea! I'd love to use it myself but my boat only has metal tanks everywhere...
SensESP itself doesn't have a capacitive library but using the capacitive touch sensors with the Arduino Framework is so simple that you don't necessarily need one. You can fake a SensESP sensor with an type variable that you then update externally. Transforms and outputs can be connected to that variable and when the variable value is updated, the variable will emit the value updates just like any other input. Something like this should work:
This would read the capacitive touch sensor every 100 ms and emit the updates to whoever is listening.
As to your second question, the serial port baud rate can indeed be adjusted. At the moment the value is hard-coded but can be changed easily. See line 54 of the main.cpp file of the nmea2000 gateway example. If you change the value there to 250000 and then build and upload, that should do it.
I'll need to look into making the baud rate configurable...
Using the ESP32 capacitive touch capabilities to read tank levels is a brilliant idea! I'd love to use it myself but my boat only has metal tanks everywhere...
SensESP itself doesn't have a capacitive library but using the capacitive touch sensors with the Arduino Framework is so simple that you don't necessarily need one. You can fake a SensESP sensor with an
Code:
ObservableValue<int>
Code:
auto touch_sensor = new ObservableValue<int>();
app.onRepeat(100, [touch_sensor]() {
touch_sensor = touchRead(4); // read the touch sensor connected to GPIO 4
});
touch_sensor->connect_to(...);
This would read the capacitive touch sensor every 100 ms and emit the updates to whoever is listening.
As to your second question, the serial port baud rate can indeed be adjusted. At the moment the value is hard-coded but can be changed easily. See line 54 of the main.cpp file of the nmea2000 gateway example. If you change the value there to 250000 and then build and upload, that should do it.
I'll need to look into making the baud rate configurable...