     // pattern: 0 = this led only, 1 all leds except this led, 2 this led and all leds inwards, 3 this led and all leds outwards
     // which led: 0 = led closest to the GrovePi, 1 = second led counting outwards
     // [93, pin, pattern, which led]
-    else if(cmd[0] == 93)
+    else if(cmd[0] == CMD_CLED_SET_PATTERN)
     {
       if(cmd[2] == 0) {
         // set an individual led to the stored color

      //Serial.println(val);
    }
    //Digital Write
    else if(cmd[0]==2)
      digitalWrite(cmd[1],cmd[2]);

    //Analog Read
    else if(cmd[0]==3)
    {
      aRead=analogRead(cmd[1]);
      b[1]=aRead/256;

    //                       |        |
    //                       10       1
    // [55, pin, bits 1-8, bits 9-10]
    else if(cmd[0] == CMD_LED_BAR_SET_STATE && ledbar[cmd[1]-2].ready())
    {
      ledbar[cmd[1]-2].setBits(cmd[2] ^ (cmd[3] << 8));
    }

    // Return the current state
    // [56, pin, unused, unused]
    else if(cmd[0] == CMD_LED_BAR_RET_STATE && ledbar[cmd[1]-2].ready())
    {
      unsigned int state = ledbar[cmd[1]-2].getBits();
      b[1] = state & 0xFF;
