# Sender/receiver

**URL:** https://forum.makecode.com/t/sender-receiver/28614
**Category:** micro:bit
**Created:** [May 6, 2024, 3:31pm UTC](https://forum.makecode.com/t/sender-receiver/28614 "2024-05-06T15:31:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ozgetasmanisa](https://avatars.discourse-cdn.com/v4/letter/o/b19c9b/32.png) [@ozgetasmanisa](https://forum.makecode.com/u/ozgetasmanisa)
#### Post date: [May 6, 2024, 3:31pm UTC](https://forum.makecode.com/t/sender-receiver/28614/1 "2024-05-06T15:31:54Z")

</div>

Hello i try alarm with motion sensor. I have two microbits. One of them has motion sensor on it (micoribt1). When i press a button alarm is active and remote microbit (microbit2) is active too. I can do from microbit 1 active or passive microbit 2. And i want to reversely it too. When i press microbit 2 a button i want to active microbit1 alarm and when i press button B at microbit 2 i want to passive alarm on microbit1. I try lots of things. I think problem is that. when i press button A it works while b is not pressed and send always radio signal. When i press and send signal from other microbit itcouldnt be receive from the other because it sende signal at the same time. What can i do?

---

<div class="post-metadata">

### Author: ![ozgetasmanisa](https://avatars.discourse-cdn.com/v4/letter/o/b19c9b/32.png) [@ozgetasmanisa](https://forum.makecode.com/u/ozgetasmanisa)
#### Post date: [May 6, 2024, 6:56pm UTC](https://forum.makecode.com/t/sender-receiver/28614/2 "2024-05-06T18:56:08Z")

</div>

![alarm microbit1](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/9/9a3bd05d72d2a31cb6c0301fa03a28886b37aa81.jpeg)  
microbit1 code

---

<div class="post-metadata">

### Author: ![ozgetasmanisa](https://avatars.discourse-cdn.com/v4/letter/o/b19c9b/32.png) [@ozgetasmanisa](https://forum.makecode.com/u/ozgetasmanisa)
#### Post date: [May 6, 2024, 6:56pm UTC](https://forum.makecode.com/t/sender-receiver/28614/3 "2024-05-06T18:56:09Z")

</div>

![remote microbit2](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/d/dfd21a9b79fbf805265453554f6b7f5da35318f4.jpeg)  
remote microbit2 code

---

<div class="post-metadata">

### Author: ![bsiever](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bsiever/32/1032_2.png) [@bsiever](https://forum.makecode.com/u/bsiever)
#### Post date: [May 7, 2024, 3:08am UTC](https://forum.makecode.com/t/sender-receiver/28614/4 "2024-05-07T03:08:02Z")

</div>

Hi @ozgetasmanisa — Welcome to the forum!

It may be easier to review if you share links to your two programs, as described here: [https://makecode.microbit.org/share](https://makecode.microbit.org/share) .

You may also want to try debugging your work in the Multi-Editor, which will allow you to open both programs side-by-side and simulate how they work together: [https://makecode.microbit.org/---multi#](https://makecode.microbit.org/---multi#) .

While loops can sometimes cause problems. You may want to avoid the `while not button B is pressed` loop. You may be able to use a variable to keep track of the “mode” and then a `forever` loop that behaves differently depending on the current mode.
