Program + buzzer at one time [SOLUTED]

I found a tetris project but the program doesnt have sounds
So i wanted to added sound ussing buzzer but i dont know how to run the tetris program and buzzer mini program at one time.
Is there some way to do that ? ??? ::slight_smile:
(I did music code using only tone and delay)

SOLUTION: I find how to make it using .cpp library

Have a look at Using millis() for timing. A beginners guide, Several things at the same time and look at the BlinkWithoutDelay example in the IDE.

ok. i looked to "several..." and there was:
" void loop() {
** currentMillis = millis();**
** switchLeds();**
** servoSweep(); "**
and
"void switchLeds()" + "void ServoSweep()" ETC...
i try that with buzzer and led diode before i post a question, but the music play first and the led blink after the music stop.... =/ CODE

If you want help HERE, post your code HERE.

PaulS:
If you want help HERE, post your code HERE.

the program exceeds 9000characters…
so there is .ino file…

TetrisANDLed_Test.ino (11.1 KB)

The examples that UKHeliBob linked do NOT use delay(). You seem to have missed that extremely important point.

You also seem to have missed the fact that delay() takes an integral value.

You also seem to have missed the fact that a float on the Arduino has only 6 to 7 digits of accuracy. Your expectation of 11 digits is quite unrealistic.

PaulS:
Your expectation of 11 digits is quite unrealistic.

arduino nano has 12 digitals....

TobiasCZe:
arduino nano has 12 digitals....

12 digital what ?