docs: @Override
    public double getImmediateValue(final Pin pin) throws IOException {
      // Pin address to read from to device
      int command = (configuration & 0x9F) | (pin.getAddress() << 5);
      device.write((byte)command); // Write configuration to device
  
      double rate = 0.0;
      byte data[] = null;
      switch (configuration & 0x0C) {
        case 0x00: {
          data = new byte[3];
      	rate = 176.0 /*240.0*/;
          break;
        }
        case 0x04: {
          data = new byte[3];
          rate = 44.0  /*60.0 */;
          break;
        }
        case 0x08: {
          data = new byte[3];
          rate = 11.0  /*15.0 */;
          break;
        }
        case 0x0C: {
          data = new byte[4];
          rate = 2.75  /*3.75 */;
          break;
        }
        default: throw new IllegalArgumentException();
      }
  
      // Sleep current thread during conversion
      try {
        Thread.sleep((long)Math.ceil(1000.0 / rate));
  	} catch (InterruptedException ex) {
        ex.printStackTrace();
  	}
  
      // Get answer from device
      device.read(data, 0, data.length);
  
      int answer = data[data.length - 1] & 0xFF;
      double weight = (data[0] & 0x80) == 0 ? 1 : -1;
  //    weight = weight / (1 << (answer & 0x03));
      if(((answer & 0x60) == (command & 0x60)) && ((answer & 0x80) == 0)) {
        if(weight < 0) {
          for (int i = 0; i < data.length - 1; i++) {
            data[i] = (byte)(~data[i] & 0xFF);
          }
          data[data.length - 2] = (byte)(data[data.length - 2] + 1);
        }
  
        switch (configuration & 0x0C) {
          case 0x00: {
            data[0] = (byte)(data[0] & 0x07);
            break;
          }
          case 0x04: {
            data[0] = (byte)(data[0] & 0x1F);
            break;
          }
          case 0x08: {
            data[0] = (byte)(data[0] & 0x7F);
            break;
          }
          case 0x0C: {
            data[0] = (byte)(data[0] & 0x01);
            break;
          }
          default: throw new IllegalArgumentException();
        }
  
        int buffer = data[0] & 0xFF;
        for (int i = 1; i < data.length - 1; i++) {
          buffer = (buffer << 8) | (data[i] & 0xFF);
        }
  
        // validate value within acceptable range
        double value = buffer * weight;
  	  if (value >= getMinSupportedValue() && value <= getMaxSupportedValue()) {
  		getPinCache(pin).setAnalogValue(value);
  		return value;
  	  }
      }
      return INVALID_VALUE;
    }