HI all…I’m just in the beginning stages of trying to have a gesture sensor control the power to my t.v., stereo, computer, using IR.
This is the first trial. I’ve got the IR working for TV and stereo, so I am now trying to have it controlled using a button. So if the button is high, the program sends the IR signal. I continue to get the following error:
exit status 1
expected primary-expression before ‘==’ token
this is my code…I’ve looked online, looked in books, I can’t seem to figure out where I’ve gone wrong…the error is highlighted in my if statement right after the void loop.
If anyone can shed some light, I would be eternally grateful!!!
#include <IRremote.h>
IRsend irsend;
unsigned int raw1[68]={4450,4500,500,1700,500,1750,500,1700,500,650,500,600,450,650,500,600,500,600,500,1750,500,1700,500,1750,500,600,450,650,500,600,500,650,450,650,450,650,500,1750,450,650,500,600,450,650,500,600,500,650,450,650,450,1750,500,600,500,1750,450,1750,500,1750,450,1750,500,1750,450,1750,500,};
unsigned int raw2[32]={2300,650,1100,700,500,650,1100,700,500,650,1100,650,550,650,550,600,550,700,500,650,500,650,550,650,1100,650,550,650,1150,600,550,};
const int button=7;
int buttonState=0;
void setup(){
pinMode(button, INPUT);
}
void loop() {
buttonState = digitalRead(button);
if (buttonState == HIGH) { ==HIGH){
for (int i = 0; i < 3; i++) {
irsend.sendRaw(raw2,32,38);
delay(40);
//digitalWrite(led, HIGH);
}
irsend.sendRaw(raw1,68,38);
delay(10000); //5 second delay between each signal burst
//digitalWrite(led, LOW);
delay(10);
buttonState=LOW;
}
}