eRCaGuy_Timer2_Counter (downloadable Arduino library)

$0+
8 ratings

Recommended donation: $5 for home use; $50~$100+ for business use under the included copy-left, open-source GNU GPLV3 or later license (contact me for other license options).

Enter a donation amount, or $0, above. Donations are greatly appreciated. 

License: open-source, copy-left GNU GPLV3 or later license. Commercial (closed-source, proprietary) licenses sold at request. Contact me if desired.


Have you ever noticed that when you call the Arduino micros() function, it only returns values in multiples of 4 microseconds? Have you ever wished you could get higher-resolution time-stamps, to decrease error and jitter when reading pulse widths or frequencies? If so, this library is for you! It will give you a substitute for the micros() function with up to 8x better resolution.

"Dude, your lib is really very useful and precise." ~André Frazatto

"Thanks for posting this code, it saved me from a couple more hours of debugging" ~Adam Krasuski

Your donations brighten my day, help support my family, and keep me doing and sharing my projects! :)

This Arduino library allows you to call a method like timer2.get_micros() in place of just micros(), in order to get a time stamp with a resolution of 0.5us instead of 4us. This is very useful when you need to determine periods and frequencies very precisely. Check out the examples. You may find the "read_PWM_pulses_on_ANY_pin_via_pin_change_interrupt" example especially useful, as it will measure the period of a PWM pulse, fast or slow, on *any* pin, and print the result to the serial monitor. This can be used to read an RC PWM pulse as well.

Library webpage: http://www.electricrcaircraftguy.com/2014/02/Timer2Counter-more-precise-Arduino-micros-function.html.

$
I want this!
2,915 downloads

You'll get one downloadable zip file.

Required Software
Arduino IDE
Required Hardware
Arduino Uno or similar
License
GPLV3 or later (contact me if you'd like to purchase an alternate license)
Copy product URL

Ratings

5.0
(8 ratings)
5 stars
100%
4 stars
0%
3 stars
0%
2 stars
0%
1 star
0%
$0+

eRCaGuy_Timer2_Counter (downloadable Arduino library)

8 ratings
I want this!