The code uses the internal HW timers of the CPU, and so it isn't really convertible to the arduino-style sketch (where the HW timers are used to provide PWM for analogWrite, and normal programmers aren't expected to touch the timers. It should still WORK within a sketch, assuming you don't need the timers for something else.
You'd probably want to replace the uart and lcd code with the standard arduino stuff.
Stripping the LCD code and replacing the uart with arduino serial calls, I get the following, which compiles and seems to work...
// based on backlight.c
// from NerdKits by mrobbins@mit.edu
// rewritten for (mostly) arduino environment
// LCD code removed; this manipulates the backlight only
// PIN DEFINITIONS:
//
// PB1 (D9) -- OC1A -- backlight high-speed switchy thing (nFET gate)
// used to generate the high voltage supply
// PB3 (D11) -- OC2A -- backlight low-speed switchy thing (nFET gate)
// used to pulse the AC to the electroluminescent
void setup() {
// PB1,3 as output
DDRB |= (1<<PB1) | (1<<PB2) | (1<<PB3);
// Timer1: Toggle CTC, 10-bit, non-inverting, clocked from CLK/1
TCCR1A = (1<<COM1A0);
TCCR1B = (1<<WGM12) | (1<<CS10);
OCR1A = 51; // 141 kHz, or it would be a 14.x MHz
// Timer2: Toggle CTC, clocked from CLK/1024
TCCR2A = (1<<COM2A0) | (1<<WGM21);
TCCR2B = (1<<CS22) | (1<<CS21) | (1<<CS20);
OCR2A = 40; // 175 Hz
// init serial port
Serial.begin(9600);
}
void loop()
{
double freq_a, freq_b;
char x;
// allow user to adjust timings via serial port
if(Serial.available()) {
x = Serial.read();
if(x == 'w') {
OCR1A += 1;
}
else if(x=='q') {
OCR1A -= 1;
}
else if(x=='s') {
OCR2A += 1;
}
else if(x=='a') {
OCR2A -= 1;
}
// convert to human-readable frequencies
freq_a = F_CPU;
freq_a = freq_a / 2.0 / (OCR1A+1.0);
freq_b = F_CPU;
freq_b = freq_b / 2.0 / 1024.0 / (OCR2A+1.0);
Serial.print("OCR1A=");
Serial.print((int)OCR1A);
Serial.print(", ");
Serial.print(freq_a);
Serial.print(" | OCR2A=");
Serial.print((int)OCR2A);
Serial.print(", ");
Serial.println(freq_b);
} // Serial.available
}