private void changeMotorSpeed(int motor, int speed) {
    if (speed > 100) speed = 100;
    else if (speed < -100) speed = -100;

    byte[] message = LCPMessage.getMotorMessage(motor, speed);
    sendMessageAndState(message);
  }
 private void findFiles(boolean findFirst, int handle) {
   byte[] message = LCPMessage.getFindFilesMessage(findFirst, handle, "*.*");
   sendMessageAndState(message);
 }
 private void getFirmwareVersion() {
   byte[] message = LCPMessage.getFirmwareVersionMessage();
   sendMessageAndState(message);
 }
 private void readMotorState(int motor) {
   byte[] message = LCPMessage.getOutputStateMessage(motor);
   sendMessageAndState(message);
 }
 private void reset(int motor) {
   byte[] message = LCPMessage.getResetMessage(motor);
   sendMessageAndState(message);
 }
 private void rotateTo(int motor, int end) {
   byte[] message = LCPMessage.getMotorMessage(motor, -80, end);
   sendMessageAndState(message);
 }
 private void getProgramName() {
   byte[] message = LCPMessage.getProgramNameMessage();
   sendMessageAndState(message);
 }
 private void stopProgram() {
   byte[] message = LCPMessage.getStopProgramMessage();
   sendMessageAndState(message);
 }
 private void startProgram(String programName) {
   byte[] message = LCPMessage.getStartProgramMessage(programName);
   sendMessageAndState(message);
 }
 private void doAction(int actionNr) {
   byte[] message = LCPMessage.getActionMessage(actionNr);
   sendMessageAndState(message);
 }
 private void doBeep(int frequency, int duration) {
   byte[] message = LCPMessage.getBeepMessage(frequency, duration);
   sendMessageAndState(message);
   waitSomeTime(20);
 }