irsend.sendNEC(int, int) Argument Error

#include <IRremote.h>

IRsend irsend;

const uint8_t LED_PIN = 3; // Predefined by IRsend, cannot change?
const uint8_t MAGIC_VALUE = 37;
void setup() {
pinMode(LED_PIN, OUTPUT);
Serial.begin(4800);
}

void loop() {
Serial.println("Sending signal");
irsend.sendNEC(0x000025, 32); //Why? error: candidate expects 4 arguments, 2 provided
delay(2000);
}

The above is my code
I got error of the "irsend.sendNEC(0x000025, 32);" part like below.

ir-transmit:14:32: error: no matching function for call to 'IRsend::sendNEC(int, int)'
irsend.sendNEC(0x000025, 32); //Why? error: candidate expects 4 arguments, 2 provided
^
In file included from /Users/sangjunerhee/Documents/Arduino/libraries/Arduino-IRremote-master/src/IRremote.h:94:0,
from /Users/sangjunerhee/Desktop/Arduino/Arduino-Gabriel/ir-comms-cog/ir-comms-send/ir-transmit/ir-transmit.ino:1:
/Users/sangjunerhee/Documents/Arduino/libraries/Arduino-IRremote-master/src/IRremoteInt.h:396:10: note: candidate: void IRsend::sendNEC(uint16_t, uint8_t, uint_fast8_t, bool)
void sendNEC(uint16_t aAddress, uint8_t aCommand, uint_fast8_t aNumberOfRepeats, bool aIsRepeat = false);
^~~~~~~
/Users/sangjunerhee/Documents/Arduino/libraries/Arduino-IRremote-master/src/IRremoteInt.h:396:10: note: candidate expects 4 arguments, 2 provided
exit status 1
no matching function for call to 'IRsend::sendNEC(int, int)'

I think sendNEC() has two arguments and both should be an integer, but the error said expects 4 arguments. Do anyone have any idea?

 void sendNEC(uint16_t aAddress, uint8_t aCommand, uint_fast8_t aNumberOfRepeats, bool aIsRepeat = false);

There are 4 arguments for this method with the last one as a default argument. This means you must provide at least the first 3 arguments. Provide the number of repeats parameter and it will compile.

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