I am trying to play simple melody and at the same time read signal from ir remote, so when the key is pressed the speed of the melody should change. I realized that this is not posible with tone() function, so i'm using another tone library. And instead of delay i use millis. Still, i can't figure out how the code should look like.
This current code compiles normaly but everyting I get from speaker is some noise. Any ideas?