IR remote control help

just trying to get my receiver to turn on or off to start but cant get it working.

heres what i got for the power button
Protocol=SONY Address=0x10 Command=0x15 Repeat gap=25550us Raw-Data=0x815 12 bits LSB first

this is the code im trying but keep getting void sendSony(unsigned long data,
not sure what to do now

#include <IRremote.h>

const int button1 = 5;
const int button2 = 6;
const int button3 = 7;

int buttonState = 0;
 
IRsend irsend;
 
void setup(){
 
  pinMode(button1, INPUT);
  pinMode(button2, INPUT);
  pinMode(button3, INPUT);
} 

void loop(){
  
  if(digitalRead(button1) == HIGH) 
    irsend.sendSony(0x815, 12);
    delay(40);
}

What does that mean? Getting "void sendSony(unsigned long data," where?

If it is a compile error please include the entire error message. It is easy to do. There is a button (lower right of the IDE window) called "copy error message". Copy the error and paste into a post in code tags. Paraphrasing the error message leaves out important information.

Is the delay supposed to be part of the if block. If so, there needs to be curly brackets around all of the lines of code that belong in the if block.

if(digitalRead(button1) == HIGH) 
{
    irsend.sendSony(0x815, 12);
    delay(40);
}

this is what comes up in orange writing after clicking verfiey

C:\Users\t\Documents\Arduino\ir_send_2\ir_send_2.ino: In function 'void loop()':
C:\Users\t\Documents\Arduino\ir_send_2\ir_send_2.ino:23:28: warning: 'void IRsend::sendSony(long unsigned int, int)' is deprecated: This old function sends MSB first! Please use sendSony(aAddress, aCommand, aNumberOfRepeats). [-Wdeprecated-declarations]
irsend.sendSony(0x815, 12);
^

In file included from C:\Users\t\Documents\Arduino\libraries\IRremote\src/IRremote.h:191:0,
from C:\Users\t\Documents\Arduino\ir_send_2\ir_send_2.ino:1:
C:\Users\t\Documents\Arduino\libraries\IRremote\src/IRremoteInt.h:538:10: note: declared here
void sendSony(unsigned long data,
^~~~~~~~

I think the library is asking you to use:
'irsend.sendSony(0x10, 0x15, 3);`

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.