How to control Arduino frequency?
The code in your example is written for a 7.9MHz clocked CPU:

#define F_CPU 7900000 // clock frequency, set according to clock used!


Whereas Arduino runs at 16MHz. Since all delays in the code _delay_ms(HPERIOD); are in milliseconds, you should be just fine by deleting that first F_CPU line from the source and recompiling it. Arduino automatically uses the correct frequency for for your board (16MHz).