This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sailor Hat with ESP32
#16
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
Code:
ObservableValue<int>
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:

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...
Reply


Messages In This Thread
Sailor Hat with ESP32 - by mairas - 2021-03-29, 10:09 AM
RE: Sailor Hat with ESP32 - by Sailoog - 2021-03-29, 12:50 PM
RE: Sailor Hat with ESP32 - by mairas - 2021-03-29, 12:59 PM
RE: Sailor Hat with ESP32 - by Sailoog - 2021-03-29, 01:12 PM
RE: Sailor Hat with ESP32 - by mairas - 2021-04-01, 07:06 PM
RE: Sailor Hat with ESP32 - by SCarns - 2021-05-18, 03:35 AM
RE: Sailor Hat with ESP32 - by mairas - 2021-05-19, 07:37 AM
RE: Sailor Hat with ESP32 - by SCarns - 2021-05-19, 04:07 PM
RE: Sailor Hat with ESP32 - by SCarns - 2021-06-24, 09:00 PM
RE: Sailor Hat with ESP32 - by mairas - 2021-06-26, 12:08 PM
RE: Sailor Hat with ESP32 - by theseal - 2021-05-18, 11:40 AM
RE: Sailor Hat with ESP32 - by SCarns - 2021-06-26, 11:14 PM
RE: Sailor Hat with ESP32 - by mairas - 2021-06-28, 03:22 PM
RE: Sailor Hat with ESP32 - by SCarns - 2021-07-03, 05:47 PM
RE: Sailor Hat with ESP32 - by SCarns - 2021-07-21, 06:33 PM
RE: Sailor Hat with ESP32 - by mairas - 2021-07-23, 08:38 PM
RE: Sailor Hat with ESP32 - by SCarns - 2021-11-22, 12:18 PM
RE: Sailor Hat with ESP32 - by dwynalda - 2023-12-07, 02:45 PM
RE: Sailor Hat with ESP32 - by SCarns - 2023-12-08, 01:51 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)