Hi,
I am trying to program a IR sensor and am getting the following error. I have the code also. I have tried changing everything and cannot seem to figure out what the error is saying.
expected constructor, destructor, or type conversion before '(' token
pinMode(IRledPin, OUTPUT);
pinMode(IRledPin, OUTPUT);
Serial.begin(9600);
}
void loop()
{
SendChannelUpCode();
delay(20*1000); // wait twenty seconds (20 seconds * 1000 milliseconds) Change this value for different intervals.
}
// This procedure sends a 38KHz pulse to the IRledPin
// for a certain # of microseconds. We'll use this whenever we need to send codes
void pulseIR(long microsecs) {
// we'll count down from the number of microseconds we are told to wait
cli(); // this turns off any background interrupts
while (microsecs > 0) {
// 38 kHz is about 13 microseconds high and 13 microseconds low
digitalWrite(IRledPin, HIGH); // this takes about 3 microseconds to happen
delayMicroseconds(10); // hang out for 10 microseconds
digitalWrite(IRledPin, LOW); // this also takes about 3 microseconds
delayMicroseconds(10); // hang out for 10 microseconds
// so 26 microseconds altogether
microsecs -= 26;
}
sei(); // this turns them back on
}
void SendChannelUpCode() {
// This is the code for the CHANNEL + for the TV COMCAST
delayMicroseconds(36328); //Time off (LEFT column)
pulseIR(280); //Time on (RIGHT column) <-------DO NOT