Hi all
I am trying to control a Mitsubishi Heat Pump Air Conditioning Unit. I am using Ken Sherrif's latest experimental IRRemote library.
I have increased the constant RAWBUF because the heat pump remote seems to send 180 values with each button press.
#define RAWBUF 255 // Length of raw duration buffer - IRRemote.H
I can reliababily capture button sequences but when I try to play back it does not work - ie Nothing happens on the heat pump.
Here is my sketch
#include <IRremote.h>
int RECV_PIN = 11;
// ON
//Unknown encoding: 3DF7796E (32 bits)
//Raw (180): -8014 3200 -1550 450 -350 450 -1150 400 -400 400 -400 400 -1150 450 -350 450 -1150 400 -400 400 -350 450 -1150 400 -1200 400 -1150 450 -350 400 -1200 400 -350 450 -1150 400 -1200 400 -1150 450 -350 450 -350 400 -400 400 -400 400 -1150 450 -1150 400 -400 400 -1150 450 -1150 400 -400 400 -400 400 -1150 450 -350 400 -400 400 -1200 400 -350 450 -350 400 -1200 400 -1150 450 -350 450 -1150 400 -1150 450 -350 450 -1150 400 -1200 400 -1150 450 -350 400 -1200 400 -350 450 -1150 400 -1200 400 -400 400 -350 450 -350 400 -1200 400 -400 400 -1150 450 -350 400 -1200 400 -1150 450 -1150 400 -1200 400 -350 450 -1150 400 -1200 400 -350 450 -350 450 -350 400 -400 400 -400 400 -1150 450 -350 400 -400 400 -1200 400 -1150 450 -1150 400 -400 400 -350 450 -1150 400 -1200 400 -400 400 -1150 450 -350 400 -400 400 -1150 450 -1150 400 -400 400 -400 400 -1150 450 -350 400// OFF
// Unknown encoding: 364B214A (32 bits)
// Raw (180): -13552 3200 -1550 450 -350 400 -1150 450 -350 450 -350 450 -1150 400 -350 450 -1150 450 -350 400 -400 400 -1150 450 -1150 400 -1200 400 -350 450 -1150 450 -350 400 -1200 400 -1150 450 -1150 400 -400 400 -350 450 -350 450 -350 400 -1200 400 -1150 450 -350 450 -1150 400 -1150 450 -350 450 -350 400 -1200 400 -350 450 -350 450 -1150 400 -400 400 -400 400 -1150 450 -1150 400 -400 400 -1150 450 -1150 400 -400 400 -1150 450 -1150 400 -1200 400 -350 450 -1150 400 -400 400 -1150 450 -1150 450 -350 400 -400 400 -400 400 -1150 450 -350 400 -1200 400 -350 450 -1150 400 -1200 400 -1150 450 -1150 400 -400 400 -1150 450 -1150 400 -400 400 -400 400 -350 450 -350 450 -350 450 -1150 400 -400 400 -350 450 -1150 400 -1200 400 -1150 450 -350 400 -1200 400 -1150 450 -1150 400 -400 400 -1150 450 -350 450 -350 400 -1200 400 -350 450 -350 450 -350 450 -1150 400 -400 400unsigned int powerOn[] = {
3200,1550,400,400,400,1200,400,350,400,400,400,1200,400,400,400,1150,400,400,400,400,400,1200,350,1200,400,1200,400,400,400,1150,
400,400,400,1200,400,1150,400,1200,400,400,400,400,350,400,400,400,400,1200,400,1150,400,400,400,1200,400,1200,350,400,400,400,
400,1200,400,400,400,350,400,1200,400,400,400,400,400,1150,400,1200,400,400,400,1150,400,1200,400,400,400,1150,400,1200,400,1200,
400,400,350,1200,400,400,400,1200,400,1150,400,400,400,400,400,400,400,1150,400,400,400,1200,400,400,350,1200,400,1200,400,1200,
350,1200,400,400,400,1200,350,1200,400,1200,400,400,400,350,400,400,400,400,400,1200,400,400,350,400,400,400,400,1200,400,1150,
400,400,400,1200,400,1200,350,400,400,400,400,1200,400,400,350,400,400,1200,400,400,400,400,400,1150,400,1200,400,400,400};int incomingByte = 0;
IRsend irsend;
IRrecv irrecv(RECV_PIN);decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver}
// Dumps out the decode_results structure.
// Call this after IRrecv::decode()
// void * to work around compiler issue
//void dump(void *v) {
// decode_results *results = (decode_results *)v
void dump(decode_results *results) {
int count = results->rawlen;
if (results->decode_type == UNKNOWN) {
Serial.print("Unknown encoding: ");
}
else if (results->decode_type == NEC) {
Serial.print("Decoded NEC: ");
}
else if (results->decode_type == SONY) {
Serial.print("Decoded SONY: ");
}
else if (results->decode_type == RC5) {
Serial.print("Decoded RC5: ");
}
else if (results->decode_type == RC6) {
Serial.print("Decoded RC6: ");
}
else if (results->decode_type == PANASONIC) {
Serial.print("Decoded PANASONIC - Address: ");
Serial.print(results->panasonicAddress,HEX);
Serial.print(" Value: ");
}
else if (results->decode_type == JVC) {
Serial.print("Decoded JVC: ");
}
Serial.print(results->value, HEX);
Serial.print(" (");
Serial.print(results->bits, DEC);
Serial.println(" bits)");
Serial.print("Raw (");
Serial.print(count, DEC);
Serial.print("): ");for (int i = 0; i < count; i++) {
if ((i % 2) == 1) {
Serial.print(results->rawbuf_*USECPERTICK, DEC);_
- }*
- else {*
Serial.print(-(int)results->rawbuf_USECPERTICK, DEC);_
_ }_
_ Serial.print(" ");_
_ }_
_ Serial.println("");_
_}_
void loop() {
_ if (Serial.available() > 0) {_
_ // read the incoming byte:_
_ incomingByte = Serial.read();*_* Serial.print("Sent BIG Code");*
* irsend.sendRaw(powerOn, 179,38);*
* Serial.print("DONE");*
* }*
* if (irrecv.decode(&results)) {*
* Serial.println(results.value, HEX);*
* dump(&results);*
* irrecv.resume(); // Receive the next value*
* }*
}
[/quote]
I really do not know what I need to do next.. Any clues?
Chris