You should just be reading the integer value of the pin and storing that in the array. Apply your offset and scalar after we perform the averaging during the input sampling.