My guess is that you are not changing 'control', 'soglia1', 'soglia2', or 'soglia3' inside the loop. That mean once the condition is 'true' it will remain 'true' forever and the loop will continue while the condition is 'true' (forever). Perhaps you wanted 'if' statements instead of 'while' loops?
2 Likes