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

**URL:** <https://forum.makecode.com/t/leds-servos-and-sound-wont-work-at-same-time/29252>\
**Category:** micro:bit\
**Created:** [June 12, 2024, 4:33pm UTC](https://forum.makecode.com/t/leds-servos-and-sound-wont-work-at-same-time/29252 "2024-06-12T16:33:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackcooper](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jackcooper](https://forum.makecode.com/u/jackcooper)\
**Post date:** [June 12, 2024, 4:33pm UTC](https://forum.makecode.com/t/leds-servos-and-sound-wont-work-at-same-time/29252/1 "2024-06-12T16:33:48Z")

</div>

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?

 ![Screenshot 2024-06-12 at 4.09.52 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/731d0ecf7dae15c7550e1cc3e6af7b622c3a066b.png)

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 12, 2024, 4:43pm UTC](https://forum.makecode.com/t/leds-servos-and-sound-wont-work-at-same-time/29252/2 "2024-06-12T16:43:02Z")

</div>

@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](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/1/141d1d118cde01dc86577d47e99d742273ebeb49.png)

---

<div class="post-metadata">

**Author:** ![jackcooper](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jackcooper](https://forum.makecode.com/u/jackcooper)\
**Post date:** [June 13, 2024, 1:37pm UTC](https://forum.makecode.com/t/leds-servos-and-sound-wont-work-at-same-time/29252/3 "2024-06-13T13:37:26Z")

</div>

Worked a treat, thanks very much!
