Hi all, I'm pretty experienced in web programming but very new to arduino. I'm trying to play with it to send out an IR command to interact with some candles.
THe code is below (pretty much copied exactly from a tutorial online) however I get an error message and I don't understand why, or how to fix? Any help appreciated, thanks!
#include <IRremote.h>
#include <ir_Lego_PF_BitStreamEncoder.h>int reciever = 11;
char buttonState = LOW;
#define button 12
#define LED 13
#define StatusLED 8
//IRrecv irrecv(reciever); // disabled
IRsend irsend();
decode_results results;void setup(){
Serial.begin(9600);
//irrecv.enableIRIn(); // disabled
pinMode(button, INPUT_PULLUP);
pinMode(LED, OUTPUT);
pinMode(StatusLED, OUTPUT);
digitalWrite(StatusLED, HIGH);
delay(500);
digitalWrite(StatusLED, LOW);
delay(500);
digitalWrite(StatusLED, HIGH);
delay(500);
digitalWrite(StatusLED, LOW);
delay(500);
}
void loop(){
buttonState = digitalRead(button);
if (digitalRead(button) == LOW){
Serial.println("Button Low");
digitalWrite(StatusLED, HIGH);
for (int i = 0; i < 3; i++){
irsend.sendNEC(0x1FE20DF, 32);
delay(40);
}
delay(1000);}else{
Serial.println("Button High");
digitalWrite(StatusLED, LOW);
}
/*
if (irrecv.decode(&results)){ // disabled
Serial.println(results.value, HEX); // disabled
irrecv.resume(); // disabled
} // disabled
*/
}/*Candle Commands
- 1FE48B7 - ON
- 1FE58A7 - OFF
- 1FE20DF - RED
- 1FE30CF - WHITE
- 1FE7887 - MODE
*/
ERROR when compiling:
Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "Arduino Uno"
C:\Users\natha\OneDrive\ARDUINO\Projects\IR Receiver\Reciever_get_signals___TRANSMIT_RED_Candle\Reciever_get_signals___TRANSMIT_RED_Candle.ino: In function 'void loop()':
Reciever_get_signals___TRANSMIT_RED_Candle:35:12: error: request for member 'sendNEC' in 'irsend', which is of non-class type 'IRsend()'
irsend.sendNEC(0x1FE20DF, 32);
^~~~~~~
exit status 1
request for member 'sendNEC' in 'irsend', which is of non-class type 'IRsend()'
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Probably something really simple. but thank you in advance of any replies!