My son bought a Max:bot DIY Programmable Robot Kit, which uses a BBC Microbit.
You can see above where the Microbit slots in.
What works ...
To set the scene of our problem, we'll set aside the Max:bot for a moment and just consider the Microbit in isolation ...
Using Microsoft MakeCode, we can code a simple program to drive the LEDs on the Microbit. With the Microbit unseated from the Max:bot, and connected to a Mac over USB, we can successfully flash the Microbit with our program. As the USB cable provides power for the Microbit, the program begins running, and illuminates the LEDs as expected. If we press the Microbit reset button, the program runs from the beginning as expected.
Furthermore, if we remove the USB cable (removing the power source), and then re-cable the USB cable (providing power once more), the Microbit immediately runs the program. This shows to us we have successfully written the program to the Microbit's flash memory as it is persistent across power on/off cycles.
I note that when we power the Microbit via the USB cable, a yellow LED on the rear of the Microbit near the USB port is illuminated.
What the problem is ...
Let's now bring the Max:bot back into the fold ...
The Max:bot has a battery pack and (it would seem) provides power to the Microbit independently of the USB cable.
If we do not have the USB cable plugged into the Microbit, and we seat the Microbit in the Max:bot connector, and we turn on the Max:bot, then the Microbit appears to power on but does not run the program stored in its flash.
The Microbit instead initialises with this sequence shown on its LEDs.
I note that when powered via the Max:bot, the aforementioned yellow LED on the rear of the Microbit near the USB port does not turn on.
The question is then, why doesn't the Microbit run the flashed program when it is seated in and powered by the Max:bot.
A final observation ...
The following sequence does run the program:
- have the Max:bot powered off
- cable the USB to the Mac (Microbit powers on, loads program from flash)
- turn on the Max:bot
- uncable the USB
The question then is why is the USB required to be connected for the Microbit to boot from flash? (Because it's not practical to do so when you've got a program that actually drives the bot around).