   if (blue<=16) {Serial.print('0');}
   Serial.println(blue, HEX);
 }
+
+void setValue ( int r, int g, int b) {
+  red=r; green=g; blue=b;
+  setOutput(rgb);
+}
+

          int col1[4],col2[4];
          int *col1p[4] = {&col1[0],&col1[1],&col1[2],0};
          int *col2p[4] = {&col2[0],&col2[1],&col2[2],0};
          decodeHex(hex1,col1p);
          decodeHex(hex2,col2p);

          float timeVal = atoi(timev); //use strtol or sscanf instead

          gradientPulse(col1,col2,timeVal);

          if (DEBUG) {
            Serial.println(hex1);
            Serial.println(hex2);
            Serial.println(timev);
          }
        } else {
          Serial.println("Error: malformed gradient request");
          Serial.println(input);
        }
        break;
      }

      // begin debugging char commands
      

    }
  } else {
    // no input;

  if (input!="") { // if connected    
    switch (input[0]) {

      case 'd': {
        DEBUG=!DEBUG;
        Serial.print("Debug mode ");
        if(DEBUG)Serial.println("ON");
         else    Serial.println("OFF");
        break;
      }
      
