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?
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 .
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# .
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.
2 Likes