LEDs, servos and sound won't work at same time

Very simple code to run a servo (P0), 2 LEDs (P1&P2) and some sound effects.

For some reason, the code for the LEDs (which is in a forever loop) will not run until the onstart code reaches line 6 (after the 10s pause)… If I disconnect the onstart code, then the LEDs start flashing straight away, but something in that other code is stopping the LEDs from functioning for a while. I am wondering if somehow the music and LEDs can’t happen at once. Could it be a power draw thing for the servo?

@jackcooper forever blocks won’t start until on start finishes running

try using a “run in background” block from the control category instead of on start:

image

Worked a treat, thanks very much!