Search found 3 matches

by technerdchris
Mon Jun 01, 2020 8:17 pm
Forum: ESP32 Arduino
Topic: How to use "Pulse Counter" module usage under Arduino framework
Replies: 7
Views: 27546

Re: How to use "Pulse Counter" module usage under Arduino framework

Yes, that is a structure for initializing the PCNT hardware. I have made more steps than you in Arduino, however I have not yet been able to make it work. I am normally very good at taking code snippets and getting a solution. For example, to initialize the struct with the declaration, you must prov...
by technerdchris
Thu May 28, 2020 8:19 pm
Forum: General Discussion
Topic: Minimal configuration for PCNT?
Replies: 0
Views: 1941

Minimal configuration for PCNT?

Hi, I have a PWM set up on GPIO2 to perform a test. It would be great if I could stop the test after 2500 pulses. The previous version of the test bench used millis() and watched the time pass until 2500 * period millis had occurred and then the test stops. Now that I know PCNT exists, I want to uti...
by technerdchris
Thu May 28, 2020 7:55 pm
Forum: ESP32 Arduino
Topic: Pulse counter / totalizer usage - PCNT supporting functions
Replies: 1
Views: 6568

Re: Pulse counter / totalizer usage - PCNT supporting functions

The below code compiles for me in Arduino IDE (1.8.12 as of May 2020). I did use Sketch -> Include Library to add ESP32 library. In Windows 10, Arduino installs its libraries in the user folder documents. pcnt.h is in the folder: Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.2\tools\sdk\in...