/* * IRremote: IRsendRawDemo - demonstrates sending IR codes with sendRaw * An IR LED must be connected to Arduino PWM pin 3. (Defualt configuration for UNO class Arduinos) * Version 0.1 July, 2009 * Copyright 2009 Ken Shirriff * http://arcfn.com * * IRsendRawFlash - added by AnalysIR (via www.AnalysIR.com), 11 April 2016 * * This example shows how to send a RAW signal, from flash instead of SRAM, using the IRremote library. * * It is more efficient to use the sendNEC style function to send NEC signals. * Use of sendRaw_Flash here, serves only as an example of using the function to save SRAM with RAW signals. * * Typical Uses: Allows users to store a significant number of signals in flash for sending, without using up SRAM. * This is particularly important for sending RAW AC signal. Typically only one or 2 AC signals could be stored in SRAM using the traditional sendRAW function. * With this function a large number of RAW AC signals can be stored & sent from Flash on a standard Arduino, with no material SRAM overhead. * For even more Flash & signal storage, consider using a Mega1280/2560 with 128K/256K of available Flash vs the standard of 32k bytes. * * SRAM usage: On the Author's dev system the Arduino IDE 1.6.8 reported only 220 SRAM usage & 8,052 bytes of Flash storage used for this sketch. * In contrast, only one of the signals below will fit on a standard UNO using the example sendRAW function of IRremote (using SRAM to store the signal) */ #include IRsend irsend; //Example signals from various Hitachi AC units (very long signals) const unsigned int AC_irSignal1[] PROGMEM = {3344,1672,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,1254,418,1254,418,418,418,418,418,418,418,1254,418,418,418,418,418,1254,418,418,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,418,418,1254,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,1254,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,1254,418,418,418,1254,418,418,418,418,418,418,418,418,418,1254,418,418,418,1254,418,418,418,1254,418,1254,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418}; //AnalysIR Batch Export (IRremote) - RAW const unsigned int AC_irSignal2[] PROGMEM = {3344,1672,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,1254,418,1254,418,418,418,418,418,418,418,1254,418,418,418,418,418,1254,418,418,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,418,418,1254,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,418,418,1254,418,418,418,418,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,418,418,1254,418,418,418,418,418,1254,418,418,418,418,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418}; //AnalysIR Batch Export (IRremote) - RAW const unsigned int AC_irSignal3[] PROGMEM = {3344,1672,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,1254,418,1254,418,418,418,418,418,418,418,1254,418,418,418,418,418,1254,418,418,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,418,418,1254,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,418,418,1254,418,418,418,418,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,418,418,1254,418,418,418,418,418,1254,418,418,418,418,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418}; //AnalysIR Batch Export (IRremote) - RAW const unsigned int AC_irSignal4[] PROGMEM = {3344,1672,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,1254,418,1254,418,418,418,418,418,418,418,1254,418,418,418,418,418,1254,418,418,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,418,418,1254,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,418,418,418,418,1254,418,418,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,418,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,418,418,1254,418,418,418,418,418,1254,418,418,418,418,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418}; //AnalysIR Batch Export (IRremote) - RAW const unsigned int AC_irSignal5[] PROGMEM = {3344,1672,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,1254,418,1254,418,418,418,418,418,418,418,1254,418,418,418,418,418,1254,418,418,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,418,418,1254,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,1254,418,1254,418,418,418,418,418,1254,418,418,418,418,418,1254,418,418,418,418,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,418,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,1254,418,1254,418,1254,418,1254,418,1254,418,1254,418}; //AnalysIR Batch Export (IRremote) - RAW void setup() { //insert your own setup code here } void loop() { //replace this with your own code. while (true){ //loop forever sending the test signals, with 5 second gaps sendRAW_Flash(AC_irSignal1, sizeof(AC_irSignal1)/sizeof(int),33); //send AC signal #1 @ 33kHz delay(5000); //a good idea to have gaps between signals sendRAW_Flash(AC_irSignal2, sizeof(AC_irSignal2)/sizeof(int),36); //send AC signal #2 @ 36kHz delay(5000); //a good idea to have gaps between signals sendRAW_Flash(AC_irSignal3, sizeof(AC_irSignal3)/sizeof(int),38); //send AC signal #3 @ 38kHz delay(5000); //a good idea to have gaps between signals sendRAW_Flash(AC_irSignal4, sizeof(AC_irSignal4)/sizeof(int),40); //send AC signal #4 @ 40kHz delay(5000); //a good idea to have gaps between signals sendRAW_Flash(AC_irSignal5, sizeof(AC_irSignal5)/sizeof(int),56); //send AC signal #3 @ 56kHz delay(5000); //a good idea to have gaps between signals } } void sendRAW_Flash(const unsigned int * signalArray, unsigned int signalLength, unsigned char carrierFreq) { irsend.enableIROut(carrierFreq); //initialise the carrier frequency for each signal to be sent for (unsigned int i=0;i