In getPinValue assume the value is always an integer and convert it to an int.