About the Timer/Counter Inclass assignment "heartbeat": "heartbeat" does not require any hardware preparation. However, it is good to carefully consider what it is you are trying to do with this code. It's not immediately obvious. To make the heartbeat pattern on a PORTB LED, we must vary the brightness of the LED from dim to bright and back to dim. This action is repeated forever. A PWM varies the average current through the LED by changing the duty cycle of its output. This method for dimming the LED is far more efficient than linearly varying the current through a transistor. We will use TCNT1 as the PWM generator. TCNT1's OC1A output is the PWM output signal available at PB5. OC1A = Output Compare Register 1, output A. (There are three output compare registers; A, B and C) So that we cannot see any "flickering" from the PWM output, set the PWM frequency to about 260Hz. This is well above a human eye's ability to see. We cannot even see 60Hz flickering in most cases. 100Hz is pretty much "flicker-free", and 260Hz is a safe bet. Now, how much do we change the PWM duty cycle at each update? We want a smooth, seemingly continuous change in brightness. We have to balance two factors; the update rate of the PWM and the jump size at each update. These two factors need to yield a heartbeat of 60 beats/min. One last issue is the logarithmic response to brightness of the human eye. If our steps are linear, the heartbeat won't look quite right. The solution for this is to "eyeball" (!) how it looks and change values accordingly. One "bright spot" in all this (another pun!) is that the LED's brightness is linear with respect to the current through it. Who would have guessed how much subtlety there was in a simple heartbeat function?