Is there any way to set the current count of the PCNT?

clarkster
Posts: 47
Joined: Sat Sep 23, 2017 12:36 pm

Is there any way to set the current count of the PCNT?

Postby clarkster » Sun Mar 18, 2018 12:53 am

The count value is read only. ARGGG! Anyone know of any tricks to modify it besides counting pulses?

clarkster
Posts: 47
Joined: Sat Sep 23, 2017 12:36 pm

Re: Is there any way to set the current count of the PCNT?

Postby clarkster » Sun Mar 25, 2018 3:29 am

If it isn't possible, is it possible to fix this in the future?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Is there any way to set the current count of the PCNT?

Postby WiFive » Sun Mar 25, 2018 6:59 am

Just subtract an offset from the threshold instead?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Is there any way to set the current count of the PCNT?

Postby kolban » Sun Aug 12, 2018 4:25 am

There is an API called pcnt_counter_clear() that will reset the counter to zero.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Who is online

Users browsing this forum: No registered users and 93 guests