-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added anemometer(wind speed) sensor #611
Conversation
In general, I don’t really like this component that works on counting GPIO interrupts. This approach is still quite appropriate for the ESP8266, but the ESP32 has a hardware pulse counter. If the component supported PCNT for esp32 and used GPIO interrupts as a fallback for esp8266, this would be a different matter. In its current form, this component will not be included in the library, sorry. |
You are absolutely right. When I will have access to ESP32, I'll add ESP32 hardware pulse counter. Please leave this PR as is until I add ESP32 part |
I have modified this driver according to your suggestions but not going very well... There are two significant problems:
Maybe a macro like this will be good enough?
|
I decided to add described above changes. Now driver is using PCNT on all ESP32 chips except ESP32C3 and on ESP-IDF v5.0.0 and above, and interrupts on ESP8266 and with older ESP-IDF |
That's a horse of another color! But please run clang-format on your code. |
Ok. I am gonna add documentation and of course run clang-format on my source files(sorry about that). |
No problem, you can rename it |
OK. Ready to review |
Thank you! |
This is driver for wind sensors like this one:
https://www.amazon.com/TOPINCN-Speeds-Anemometer-Environment-Anemometers/dp/B083JFLNR7
Tested on ESP8266