[SOLUCIONADO] while{} en void loop()

Podrias usar una interrupcion hardware: