# Radio-remote control

**URL:** <https://forum.makecode.com/t/radio-remote-control/10711>\
**Category:** micro:bit\
**Created:** [November 1, 2021, 10:14pm UTC](https://forum.makecode.com/t/radio-remote-control/10711 "2021-11-01T22:14:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![voltaampere](https://avatars.discourse-cdn.com/v4/letter/v/c57346/32.png) [@voltaampere](https://forum.makecode.com/u/voltaampere)\
**Post date:** [November 1, 2021, 10:14pm UTC](https://forum.makecode.com/t/radio-remote-control/10711/1 "2021-11-01T22:14:57Z")

</div>

Hi!  
I’ve created an automate with a servo and I want to control it with a remote control. So, I use two microbit. The code for the microbit of the servo is:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/098d73ef49ee25805d201f3bf69fc6aba4bb7120.png)  
The code for the remote control is:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/3/380c581597520f66c4c84844e8d9c3181ea2462c.png)

But it does not work. I do not know if I am missing something.

---

<div class="post-metadata">

**Author:** ![MKleinSB](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mkleinsb/32/593_2.png) [@MKleinSB](https://forum.makecode.com/u/MKleinSB)\
**Post date:** [November 2, 2021, 3:35pm UTC](https://forum.makecode.com/t/radio-remote-control/10711/2 "2021-11-02T15:35:30Z")

</div>

Save receivedNumber into a variable like radionumber. Then ask if radionumber = … then  
The Problem is that the buffer with receivednumber is cleared and empty once you call it.

Good luck

Michael

---

<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:** [November 2, 2021, 3:42pm UTC](https://forum.makecode.com/t/radio-remote-control/10711/3 "2021-11-02T15:42:26Z")

</div>

The basic idea looks pretty good. You might try a few things to debug it:

- Try servo activities by themselves using Buttons A and B. For example, A for forward, B for backward, and A+B to stop. This will help you figure out if your servo works.
- Then try just radio things using the screen. Here’s another version of the receiver that may be worth trying. It’ll use the screen to show which button was pressed: [https://makecode.microbit.org/\_XVV8jFHgMFU6](https://makecode.microbit.org/_XVV8jFHgMFU6) (Notice that it’s just displaying images where you have the servo commands. I also went with `if/else-if`.)

Please post a follow up message sharing what you find or if/when you get it to work.

Bill

---

<div class="post-metadata">

**Author:** ![voltaampere](https://avatars.discourse-cdn.com/v4/letter/v/c57346/32.png) [@voltaampere](https://forum.makecode.com/u/voltaampere)\
**Post date:** [November 7, 2021, 8:27pm UTC](https://forum.makecode.com/t/radio-remote-control/10711/4 "2021-11-07T20:27:37Z")

</div>

Thank you all for your help. It works now. This way:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/4/41c4effccd8509926f1cbbe5ca70f5cca9a44cba.png)
