Improved mode1 functions loop, added potentiometer support

user input with the potentiometer needs to be perfected next