Microbit radio comms/power issue

Hi, I need some help with a microbit controlled robot.
As the robot is controlled by a microbit via a remote microbit stuck into a controller which is powered by 3 AA batteries.
The strange thing is that the only way to make the remote transmit correct intructions to the receiver is to power it via the usb port.
If it is powered via the batteries in the controller then it looks like it’s transmitting erratically and also it’s not reading the joystic values properly.
Changed microbits, changed batteries, code look okish, don’t know what to try anymore.
Any ideas?

Code below:

Remote: https://makecode.microbit.org/_cWWVR10KdTyr
Receiver: https://makecode.microbit.org/_9iqfbHP29XLc

It does sound like a “power problem”. Things you may want to do to help with debugging:

  • Which version of the micro:bit?

  • What type of joystick and/or other accessories are being used?

  • Maybe post a picture or circuit diagram to show how things are connected.

  • I worry that something about the joystick wiring is causing a short circuit or excess current draw. It’d be easiest to check this by using an additional, plain micro:bit (no joystick) with a variation of your code that uses the accelerometer value (rather than a joystick). If that works reliably on battery power, that’s a strong sign of a wiring/current draw problem. You could also test this by disconnecting additional wiring or unplugging the micro:bit from an accessory temporarily)