#include <IRremote.h>
//------------------------------------------------------------------------------
// Tell IRremote which Arduino pin is connected to the IR Receiver (TSOP4838)
//
#if defined(ESP32)
int IR_RECEIVE_PIN = 15;
#else
int IR_RECEIVE_PIN = 11;
#endif
IRrecv IrReceiver(IR_RECEIVE_PIN);
//+=============================================================================
// Configure the Arduino
//
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200); // Status message will be sent to PC at 9600 baud
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_USB) || defined(SERIAL_PORT_USBVIRTUAL)
delay(2000); // To be able to connect Serial monitor after reset and before first printout
#endif
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__));
IrReceiver.enableIRIn(); // Start the receiver
IrReceiver.blink13(true); // Enable feedback LED
Serial.print(F("Ready to receive IR signals at pin "));
Serial.println(IR_RECEIVE_PIN);
}
//+=============================================================================
// Dump out the decode_results structure.
//
void dumpInfo() {
// Check if the buffer overflowed
if (IrReceiver.results.overflow) {
Serial.println("IR code too long. Edit IRremoteInt.h and increase RAW_BUFFER_LENGTH");
return;
}
IrReceiver.printResultShort(&Serial);
Serial.print(" (");
Serial.print(IrReceiver.results.bits, DEC);
Serial.println(" bits)");
}
//+=============================================================================
// The repeating section of the code
//
void loop() {
if (IrReceiver.decode()) { // Grab an IR code
dumpInfo(); // Output the results
IrReceiver.printIRResultRawFormatted(&Serial); // Output the results in RAW format
Serial.println(); // blank line between entries
IrReceiver.printIRResultAsCArray(&Serial); // Output the results as source code array
IrReceiver.printIRResultAsCVariables(&Serial); // Output address and data as source code variables
IrReceiver.printIRResultAsPronto(&Serial);
Serial.println(); // 2 blank lines between entries
Serial.println();
IrReceiver.resume(); // Prepare for the next value
}
}
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
EL RESULTADO con el mando enviando para conectar a modo calor a 22 grados es esto
Protocol=PANASONIC Data=0x3648000 Address=0xC4D3 (48 bits)
rawData[227]:
+3150, -1650 + 600, - 950 + 600, - 950 + 600, - 300
+ 550, - 300 + 600, - 250 + 600, - 950 + 600, - 300
+ 550, - 300 + 600, - 950 + 600, - 950 + 600, - 300
+ 550, -1000 + 600, - 250 + 600, - 300 + 550, -1000
+ 550, -1000 + 600, - 250 + 600, - 950 + 600, -1000
+ 550, - 300 + 600, - 250 + 600, - 950 + 600, - 300
+ 550, - 300 + 600, - 950 + 600, - 300 + 550, - 300
+ 600, - 250 + 600, - 300 + 550, - 300 + 600, - 250
+ 600, - 300 + 550, - 300 + 600, - 250 + 600, - 300
+ 600, - 250 + 600, - 250 + 600, - 300 + 600, - 250
+ 600, - 300 + 550, - 300 + 600, - 250 + 600, - 950
+ 600, - 300 + 550, - 300 + 600, - 950 + 600, - 300
+ 550, - 300 + 600, - 950 + 600, - 300 + 550, - 300
+ 600, - 250 + 600, - 300 + 550, - 300 + 600, - 250
+ 600, - 300 + 550, -1000 + 600, - 250 + 600, - 250
+ 600, -1000 + 550, - 300 + 550, - 300 + 600, - 300
+ 550, - 300 + 550, -1000 + 550, - 350 + 550, -1000
+ 550, - 300 + 550, - 300 + 600, - 300 + 550, - 300
+ 550, - 350 + 550, - 300 + 550, - 300 + 550, - 350
+ 550, - 300 + 550, - 300 + 550, - 350 + 550, - 300
+ 550, - 300 + 600, - 300 + 550, - 300 + 550, - 300
+ 600, - 300 + 550, - 300 + 550, - 300 + 600, - 300
+ 550, - 300 + 550, - 350 + 550, - 300 + 550, - 300
+ 550, - 350 + 550, - 300 + 550, - 300 + 550, - 350
+ 550, - 300 + 550, - 300 + 600, - 300 + 550, - 300
+ 550, - 300 + 600, - 300 + 550, - 300 + 550, - 300
+ 600, - 300 + 550, - 300 + 550, - 350 + 550, - 300
+ 550, -1000 + 550, - 300 + 600, - 300 + 550, -1000
+ 550, - 300 + 550
uint16_t rawData[227] = {3150,1650, 600,950, 600,950, 600,300, 550,300, 600,250, 600,950, 600,300, 550,300, 600,950, 600,950, 600,300, 550,1000, 600,250, 600,300, 550,1000, 550,1000, 600,250, 600,950, 600,1000, 550,300, 600,250, 600,950, 600,300, 550,300, 600,950, 600,300, 550,300, 600,250, 600,300, 550,300, 600,250, 600,300, 550,300, 600,250, 600,300, 600,250, 600,250, 600,300, 600,250, 600,300, 550,300, 600,250, 600,950, 600,300, 550,300, 600,950, 600,300, 550,300, 600,950, 600,300, 550,300, 600,250, 600,300, 550,300, 600,250, 600,300, 550,1000, 600,250, 600,250, 600,1000, 550,300, 550,300, 600,300, 550,300, 550,1000, 550,350, 550,1000, 550,300, 550,300, 600,300, 550,300, 550,350, 550,300, 550,300, 550,350, 550,300, 550,300, 550,350, 550,300, 550,300, 600,300, 550,300, 550,300, 600,300, 550,300, 550,300, 600,300, 550,300, 550,350, 550,300, 550,300, 550,350, 550,300, 550,300, 550,350, 550,300, 550,300, 600,300, 550,300, 550,300, 600,300, 550,300, 550,300, 600,300, 550,300, 550,350, 550,300, 550,1000, 550,300, 600,300, 550,1000, 550,300, 550}; // Protocol=PANASONIC Data=0x3648000 Address=0xC4D3
uint16_t address = 0xC4D3;
uint16_t data = 0x3648000;
Pronto Hex: 0000 006D 0072 0000 0079 003F 0017 0025 0017 0025 0017 000C 0015 000C 0017 000A 0017 0025 0017 000C 0015 000C 0017 0025 0017 0025 0017 000C 0015 0026 0017 000A 0017 000C 0015 0026 0015 0026 0017 000A 0017 0025 0017 0026 0015 000C 0017 000A 0017 0025 0017 000C 0015 000C 0017 0025 0017 000C 0015 000C 0017 000A 0017 000C 0015 000C 0017 000A 0017 000C 0015 000C 0017 000A 0017 000C 0017 000A 0017 000A 0017 000C 0017 000A 0017 000C 0015 000C 0017 000A 0017 0025 0017 000C 0015 000C 0017 0025 0017 000C 0015 000C 0017 0025 0017 000C 0015 000C 0017 000A 0017 000C 0015 000C 0017 000A 0017 000C 0015 0026 0017 000A 0017 000A 0017 0026 0015 000C 0015 000C 0017 000C 0015 000C 0015 0026 0015 000D 0015 0026 0015 000C 0015 000C 0017 000C 0015 000C 0015 000D 0015 000C 0015 000C 0015 000D 0015 000C 0015 000C 0015 000D 0015 000C 0015 000C 0017 000C 0015 000C 0015 000C 0017 000C 0015 000C 0015 000C 0017 000C 0015 000C 0015 000D 0015 000C 0015 000C 0015 000D 0015 000C 0015 000C 0015 000D 0015 000C 0015 000C 0017 000C 0015 000C 0015 000C 0017 000C 0015 000C 0015 000C 0017 000C 0015 000C 0015 000D 0015 000C 0015 0026 0015 000C 0017 000C 0015 0026 0015 000C 0015 258F
es un protocolo de PANASONIC de 48 bits
y el programa que utilizo para enviar la señal mediante un arduino uno es
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
uint16_t engegar_aire[227] = {3150,1650, 600,950, 600,950, 600,300, 550,300, 600,250, 600,950, 600,300, 550,300, 600,950, 600,950, 600,300, 550,1000, 600,250, 600,300, 550,1000, 550,1000, 600,250, 600,950, 600,1000, 550,300, 600,250, 600,950, 600,300, 550,300, 600,950, 600,300, 550,300, 600,250, 600,300, 550,300, 600,250, 600,300, 550,300, 600,250, 600,300, 600,250, 600,250, 600,300, 600,250, 600,300, 550,300, 600,250, 600,950, 600,300, 550,300, 600,950, 600,300, 550,300, 600,950, 600,300, 550,300, 600,250, 600,300, 550,300, 600,250, 600,300, 550,1000, 600,250, 600,250, 600,1000, 550,300, 550,300, 600,300, 550,300, 550,1000, 550,350, 550,1000, 550,300, 550,300, 600,300, 550,300, 550,350, 550,300, 550,300, 550,350, 550,300, 550,300, 550,350, 550,300, 550,300, 600,300, 550,300, 550,300, 600,300, 550,300, 550,300, 600,300, 550,300, 550,350, 550,300, 550,300, 550,350, 550,300, 550,300, 550,350, 550,300, 550,300, 600,300, 550,300, 550,300, 600,300, 550,300, 550,300, 600,300, 550,300, 550,350, 550,300, 550,1000, 550,300, 600,300, 550,1000, 550,300, 550}; // Protocol=PANASONIC Data=0x3648000 Address=0xC4D3
#include <IRremote.h>
int button = 12;
char buttonState = LOW;
IRsend irsend;
int khz=38; //canviar la frequencia
void setup() {
Serial.begin(9600);
pinMode(button, INPUT);
}
void loop() {
buttonState=digitalRead(button);
if(buttonState==HIGH){
Serial.println("boto apretat");
irsend.sendRaw(engegar_aire, sizeof(engegar_aire)/sizeof(int), khz);
delay(3000);
}
delay(100);
}