code: public static byte[] setHorizontalScroll(ScrollDirection direction, byte startAddress, byte endAddress, byte speed) {
          if (startAddress < 0 || startAddress > 7 || endAddress < 0 || endAddress > 7) {
              throw new IllegalArgumentException("Start and end address must be between 0 and 7.");
          }
          if (endAddress < startAddress) {
              throw new IllegalArgumentException("End address must be larger or equal to start address.");
          }
          if (speed < 0 || speed > 7) {
              throw new IllegalArgumentException("Speed must be between 0 and 7.");
          }
          return new byte[]{
              COMMAND_CONTROL_BYTE, (byte) (SET_HORIZONTAL_SCROLL | direction.ordinal()),
              COMMAND_CONTROL_BYTE, 0, // dummy byte
              COMMAND_CONTROL_BYTE, startAddress,
              COMMAND_CONTROL_BYTE, speed,
              COMMAND_CONTROL_BYTE, endAddress,
              COMMAND_CONTROL_BYTE, 0, //dummy byte
              COMMAND_CONTROL_BYTE, (byte) 0xFF //dummy byte
          };
      }
docs: scrolling commands