code: func (d *ADS1x15Driver) AnalogRead(pin string) (value int, err error) {
  	var useDifference = false
  	var channel int
  	var read float64
  
  	// First case: the ADC is used in difference mode
  	switch pin {
  	case "0-1":
  		useDifference = true
  		channel = 0
  		break
  	case "0-3":
  		useDifference = true
  		channel = 1
  		break
  	case "1-3":
  		useDifference = true
  		channel = 2
  		break
  	case "2-3":
  		useDifference = true
  		channel = 3
  		break
  	}
  
  	if useDifference {
  		read, err = d.ReadDifferenceWithDefaults(channel)
  	} else {
  		// Second case: read the voltage at a specific pin, compared to the ground
  		channel, err = strconv.Atoi(pin)
  		if err != nil {
  			return
  		}
  
  		read, err = d.ReadWithDefaults(channel)
  	}
  
  	if err == nil {
  		value = int(gobot.ToScale(gobot.FromScale(read, 0, d.gainVoltage[d.DefaultGain]), 0, 1023))
  	}
  
  	return
  }
docs: // AnalogRead returns value from analog reading of specified pin