// ***************************************************************************************** // ************************************************************ // ************************************** // * // * Header Files // * // * #include static unsigned long oldSensor; // ***************************************************************************************** // ************************************************************ // ************************************** // * // * Functions Declaration and Implementation // * // * // * // * Decode incomming messages // * void decoder (unsigned long sensor, unsigned int protocol) { switch(sensor) { case 0x46BB06: Serial.print("PIR Sensor activated\n"); break; case 0x0551: Serial.print("Button A - on pressed\n"); break; case 0x1151: Serial.print("Button B - on pressed\n"); break; case 0x1451: Serial.print("Button C - on pressed\n"); break; case 0x1511: Serial.print("Button D - on pressed\n"); break; case 0x0554: Serial.print("Button A - off pressed\n"); break; case 0x1154: Serial.print("Button B - off pressed\n"); break; case 0x1454: Serial.print("Button C - off pressed\n"); break; case 0x1514: Serial.print("Button D - off pressed\n"); break; case 0x155F: Serial.print("Button released ?\n"); break; default: Serial.print("default case - "); Serial.print("Received 0x"); Serial.println(sensor,HEX); break; } return; }