How to let LCD code working without interrupt, while some led and buzz in delay

Hello everyone

I have Ultrasonic sensor connected to Arduino mega, and it shows the "Distance= "
I made warning code using
if(Distance <= number) { and then led with buzz code will work }
I control integer "number" by Potentiometer and also display it in LCD 2nd Line

buzz code take 5 seconds!
So I can't set new value to "number" until it will finish !!! that's so interrupt :frowning:
.
I play to make this project more advanced, but "delay()" make it laggy

I need another avoid loop so LCD will work with many codes alone, and LEDs blinking alone
Is that possible?

UltraSonic_and_LCD_and_Stuff02.ino (5.24 KB)

play to make this project more advanced, but "delay()" make it laggy

Have a look at the blink without delay example in the IDE, without delay.