• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Can't import Counter class for esp32

Q&A Forum › Category: ESP32 › Can't import Counter class for esp32
0 Vote Up Vote Down
Keith asked 3 years ago

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.

Question Tags: Pulse Counter
3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

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
 
 

0 Vote Up Vote Down
Keith answered 3 years ago

Thanks Sara – I’ll keep an eye out for any new capabilities. Kind Regards….Keith

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Ok.
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.