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
https://micropython-tve.readthedocs.io/en/counter/library/machine.Counter.html?highlight=counter
Can anyone provide guidance? I’m probably doing something stupid. Many Thanks.
Hi Keith.
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.
Regards,
Sara
Thanks Sara – I’ll keep an eye out for any new capabilities. Kind Regards….Keith