code: public static byte[] setAnalogPinValue(byte pinId, long value) {
          byte[] message;
          if (pinId <= 15 && value <= 16383) {
              message = new byte[]{(byte) (ANALOG_MESSAGE | (pinId & 0x0F)), (byte) (value & 0x7F), (byte) ((value >>> 7) & 0x7F)};
          } else {
              message = new byte[]{
                  START_SYSEX,
                  EXTENDED_ANALOG,
                  pinId,
                  (byte) (value & 0x7F),
                  (byte) ((value >>> 7) & 0x7F),
                  (byte) ((value >>> 14) & 0x7F),
                  (byte) ((value >>> 21) & 0x7F),
                  END_SYSEX
              };
          }
          return message;
      }
docs: Creates Firmata message to set value of an output pin in PWM mode.<br/>
  If pin id is beyond 15th or value is greater than we can put into
  standard analog message, extended analog message is built.
  
  @param pinId index of the pin
  @param value value to be set
  @return Firmata message to set PWM output