Ignoring the button press, are you able to print the average? If not, you have problems with your code.
.