What I would really like to do is be able to control various devices using infared. I have the on/off times and I figured out how to advance them in arrays, but I can't find out what I'm missing. I'm basing the code partially off of the tv-b-gone code:
It's something like (I don't have the code with me)
long onTime[] = {( ( (16000000.0 / 37520.0) / 2.0 ) - 1.0), 234, 234, 234 ,234..........};
int offTime[] = {0, 54, 54, 54...............};
in irPin = 3;
while (i = 0; i < 36; i++)
{
digitalWrite(irPin, HIGH);
delayMicroseconds(onTime * 10);
digitalWrite(irPin, LOW);
delayMicroseconds(offTime * 10);
}
I can see the IR blink extremely fast, but the tv is definately not turning off or on ![]()
Any ideas?