Generally, no. It might work in some simple cases, but it will block the entire processor.
The right approach is to use millis() for timing, as demonstrated here:
Or here:
https://tttapa.github.io/Arduino/MIDI/Chap04-MIDI-Controller.html#buttons
Generally, no. It might work in some simple cases, but it will block the entire processor.
The right approach is to use millis() for timing, as demonstrated here:
Or here:
https://tttapa.github.io/Arduino/MIDI/Chap04-MIDI-Controller.html#buttons