How to use a while loop to calibrate a sensor while a button is being read.