I’m looking to count pulses coming from an anemometer to a pin on the esp32. According to the micropython documentation there is a class called Counter which looks like something I could use. Trouble is I can’t import that class.
from machine import Pin, Counter
ImportError: can’t import name Counter
Can anyone provide guidance? I’m probably doing something stupid. Many Thanks.
I’m sorry for taking so long to get back to you.
I’m not sure, but after searching for a while, it seems that that class is not implemented yet. There is only the documentation as described in this discussion: https://github.com/micropython/micropython/pull/5496
Additionally, if you type help() on the REPL and explore the available modules and classes for the ESP32, there isn’t any counter class available. I also get the same error.
I might be wrong, but I’m almost sure this is the case.
Thanks Sara – I’ll keep an eye out for any new capabilities. Kind Regards….Keith