Here’s a great example of what makes the Arduino platform so great. In need of a basic frequency counter on the quick, I dug up some code & schematics based on the ATTiny2313. But just before breaking out my programmer + protoboard, I thought to have a look Arduino.cc in case someone had written similar code for Arduino. Lo and behold – Martin Nawrath’s Frequency Counter library was but a few clicks into the site’s playground section. I had the setup up and running in no time with the Arduino IDE’s serial monitor – and after a few small changes to the code, had it playing nice with a serial display. There’s also an ArduinoMega-compatible version of the library’s cpp file available here.