code: public void setPwm(Pin pin, int onPosition, int offPosition) {
          validatePin(pin, onPosition, offPosition);
          final int channel = pin.getAddress();
          validatePwmValueInRange(onPosition);
          validatePwmValueInRange(offPosition);
          if (onPosition == offPosition) {
              throw new ValidationException("ON [" + onPosition + "] and OFF [" + offPosition + "] values must be different.");
          }
          try {
              device.write(PCA9685A_LED0_ON_L + 4 * channel, (byte) (onPosition & 0xFF));
              device.write(PCA9685A_LED0_ON_H + 4 * channel, (byte) (onPosition >> 8));
              device.write(PCA9685A_LED0_OFF_L + 4 * channel, (byte) (offPosition & 0xFF));
              device.write(PCA9685A_LED0_OFF_H + 4 * channel, (byte) (offPosition >> 8));
          } catch (IOException e) {
              throw new RuntimeException("Unable to write to PWM channel [" + channel + "] values for ON [" + onPosition + "] and OFF [" + offPosition + "] position.", e);
          }
          cachePinValues(pin, onPosition, offPosition);
      }
docs: The LEDn_ON and LEDn_OFF counts can vary from 0 to 4095 max.<br>
  The LEDn_ON and LEDn_OFF count registers should never be programmed with the same values.
  <p>
  Because the loading of the LEDn_ON and LEDn_OFF registers is via the I2C-bus, and
  asynchronous to the internal oscillator, we want to ensure that we do not see any visual
  artifacts of changing the ON and OFF values. This is achieved by updating the changes at
  the end of the LOW cycle.
  
  @param pin represents channel 0..15
  @param onPosition value between 0 and 4095
  @param offPosition value between 0 and 4095