Reading the position of a flex sensor to set a limit