           FADE7                 0xE01F
 
 */
-void setup()
-{
-  Serial.begin(115200);
-  irsend.sendNEC(CODE_OFF, 32);
-  irsend.sendNEC(CODE_ON, 32);
-}
-
-void loop() {
-  irsend.sendNEC(CODE_ON, 32);
-  delay(500);
-
-  irsend.sendNEC(CODE_RED, 32);
-  delay(500);
-  for (int i = 0; i < 10; i++) {
-    irsend.sendNEC(CODE_BRIGHT_MINUS, 32);
-    delay(500);
-  }
-  for (int i = 0; i < 10; i++) {
-    irsend.sendNEC(CODE_BRIGHT_PLUS, 32);
-    delay(500);
-  }
-  irsend.sendNEC(CODE_RED, 32);
-
-  irsend.sendNEC(CODE_GREEN, 32);
-  delay(500);
-  irsend.sendNEC(CODE_BLUE, 32);
-  delay(500);
-  irsend.sendNEC(CODE_WHITE, 32);
-  delay(500);
-  irsend.sendNEC(CODE_OFF, 32);
-  delay(500);
-}
-
-

          led-fade7        0xE01F
          
*/
/* or: for a 44-key remote:
          LED_UP                0x3AC5
          LED_DOWN              0xBA45
          LED_Power_ON          0x827D

// need to strike RobotIRRemote directory in Arduino IDE libraries folder.  Name collision!
#include <IRremote.h>
#include <Streaming.h>

IRsend irsend;

#define K24_OFF          0xF740BF
#define K44_OFF          0xFF02FD
#define K24_ON           0xF7C03F
#define K44_ON           0xFF827D

#define K24_RED          0xF720DF
#define K44_RED          0xFF1AE5
#define K44_RED_UP       0xFF28D7
#define K44_RED_DOWN     0xFF08F7

#define K24_GRN          0xF7A05F
#define K44_GRN          0xFF9A65
#define K44_GRN_UP       0xFFA857
#define K44_GRN_DOWN     0xFF8877

#define K24_BLU          0xF7609F
#define K44_BLU          0xFFA25D
#define K44_BLU_UP       0xFF6897
#define K44_BLU_DOWN     0xFF48B7

#define K24_YEL          0xF728D7
#define K44_YEL          0xFF38C7

#define K24_WHT          0xF7E01F
#define K44_WHT          0xFF22DD

#define K24_DOWN         0xF7807F
#define K44_DOWN         0xFFBA45
#define K24_UP           0xF700FF
#define K44_UP           0xFF3AC5

#define K44_QUICKER      0xFFE817
#define K44_SLOWER       0xFFC837

#define K24_FLASH        0xF7D02F
#define K44_FLASH        0xFFD02F

#define K24_STROBE       0xF7F00F

#define K24_FADE         0xF7C837
#define K44_FADE3        0xFF609F
#define K44_FADE7        0xFFE01F
          
#define K24_SMOOTH       0xF7E817

#define CODE_REPEAT      0xFFFFFF

#define N_BRIGHT_STEPS   8

void setup()
{
  Serial.begin(115200);
  Serial << "Startup." << endl;
}

void loop() {
  
  Serial << "Test 24-key functions." << endl;
  send(K24_ON); Serial << "24 on." << endl;
  
  send(K24_RED); Serial << "red toggled." << endl;
  upDown(K24_UP, K24_DOWN, N_BRIGHT_STEPS, 200);
  send(K24_RED); Serial << "red toggled." << endl;

  send(K24_GRN); Serial << "grn toggled." << endl;
  upDown(K24_UP, K24_DOWN, N_BRIGHT_STEPS, 200);
  send(K24_GRN); Serial << "grn toggled." << endl;

  send(K24_BLU); Serial << "blu toggled." << endl;
  upDown(K24_UP, K24_DOWN, N_BRIGHT_STEPS, 200);
  send(K24_BLU); Serial << "blu toggled." << endl;

  send(K24_YEL); Serial << "yel toggled." << endl;
  upDown(K24_UP, K24_DOWN, N_BRIGHT_STEPS, 200);
  send(K24_YEL); Serial << "yel toggled." << endl;
  
  send(K24_WHT); Serial << "wht toggled." << endl;
  upDown(K24_UP, K24_DOWN, N_BRIGHT_STEPS, 200);
  send(K24_WHT); Serial << "wht toggled." << endl;
  
  send(K24_FADE); Serial << "fade toggled." << endl;
  sendMultiple(K24_UP, N_BRIGHT_STEPS, 5);
  delay(5000);
  sendMultiple(K24_DOWN, N_BRIGHT_STEPS, 5);
  send(K24_FADE); Serial << "fade toggled." << endl;
  
  Serial << "End 24-key tests." << endl;
  send(K24_OFF); Serial << "24 off." << endl;
  
  while(1);
}

void send(unsigned long data) {
  // simple wrapper
  irsend.sendNEC(data, 32);
}

void sendMultiple(unsigned long data, int steps, unsigned long dtime) {
  for( int i=0; i<steps; i++ ) {
    send(data); Serial << i << " ";
    delay(dtime);
  }
  Serial << endl;
}

void upDown(unsigned long up, unsigned long down, int steps, unsigned long dtime) {
  Serial << "up: ";
  sendMultiple(up, steps, dtime);
  Serial << "down: ";
  sendMultiple(down, steps, dtime);
}

/* from http://forum.osmc.tv/showthread.php?tid=7142
44-key:

      led-brighter            0x3AC5
          led-dim               0xBA45
