 
 
 
-int lastButtonState; //@Lanchinho, seria isto aqui o ultimo estado do btn 1 ?
 
 void printDadosBotao(int pressed_button){
-
-    // int codeType;// -1 should be the default
-    // int toggle;  //0 should be the default; The RC5/6 toggle state
-    // unsigned long codeValue; // The code value if not raw
-    // unsigned int rawCodes[RAWBUF]; // The durations if raw
-    // int codeLen; // The length of the code
 
     Serial.println("Dados Button");
     Serial.println("codeType:");

        irrecv.resume(); // resume receiver
        digitalWrite(STATUS_PIN, LOW);
    }
    lastButtonState = firstButtonState;

//==========================================================================
//Btn2
    // if (lastBtnStateOfBtn2 == HIGH && secondButtonState == LOW)
    // {
    //     Serial.println("Released");
    //     irrecv.enableIRIn(); // Re-enable receiver
    // }

    // if (secondButtonState)
    // {
    //     Serial.println("Pressed, sending");
    //     digitalWrite(STATUS_PIN, HIGH);
    //     sendCode(lastBtnStateOfBtn2 == secondButtonState);
    //     digitalWrite(STATUS_PIN, LOW);
    //     delay(50); // Wait a bit between retransmissions
    // }
    // else if (irrecv.decode(&results))
    // {
    //     digitalWrite(STATUS_PIN, HIGH);
    //     storeCode(&results);
    //     irrecv.resume(); // resume receiver
    //     digitalWrite(STATUS_PIN, LOW);
    // }
    // lastBtnStateOfBtn2 = lastBtnStateOfBtn2;

    // //Btn 3
    // if (lastBtnStateOfBtn3 == HIGH && thirdButtonState == LOW)
    // {
    //     Serial.println("Released");
    //     irrecv.enableIRIn(); // Re-enable receiver
    // }

    // if (thirdButtonState)
    // {
    //     Serial.println("Pressed, sending");
    //     digitalWrite(STATUS_PIN, HIGH);
    //     sendCode(lastBtnStateOfBtn3 == thirdButtonState);
    //     digitalWrite(STATUS_PIN, LOW);
    //     delay(50); // Wait a bit between retransmissions
    // }
    // else if (irrecv.decode(&results))
    // {
    //     digitalWrite(STATUS_PIN, HIGH);
    //     storeCode(&results);
    //     irrecv.resume(); // resume receiver
    //     digitalWrite(STATUS_PIN, LOW);
    // }
    // lastBtnStateOfBtn3 = thirdButtonState;
//===========================================================






}

    Serial.begin(9600);
    irrecv.enableIRIn(); // Start the receiver
    pinMode(FIRST_BUTTON_PIN, INPUT);
    pinMode(SECOND_BUTTON_PIN, INPUT);
    // pinMode(THIRD_BUTTON_PIN, INPUT);
    pinMode(STATUS_PIN, OUTPUT);
}



// Stores the code for later playback
