   updateLeds();
   delay(200);
 }
-

                }
		lastLedState[id] = nval;
	}
  }
  }
}


	}
}

// commands like: ^L{GR}{id}={val}$
// format: "^LG1=0$" turn off green led 1 (RCS), "^LR2=1$" turn off red led 2 (SCS)
void handleSerialInputLed() {
    uint8_t c;
    uint8_t val=0,id=0,nval=0;
    c = Serial.read();
    id = Serial.parseInt();  // skip '='
    val = Serial.parseInt(); // skip newline
//    Serial.print(c); Serial.print(id); Serial.println(val);  // echo for ack
	if (id>=0 && id<=nPins) {
                nval = lastLedState[id];
                if (c=='G') {
                  nval = nval & 0b11111010;
