Skip to main content

Posts

Showing posts with the label mu

Do it yourself: 'Radio' Controlled Micro:Bit Junkbot

I In an earlier  post , I showed how you could build a Micro:Bit controlled Junkbot. In this post I want to show a modification to it, to use one Micro:Bit to control the junkbot controlled by another Micro:Bit. A nice feature of the Micro:Bit using micropython, is it can send and receive simple messages via radio - so here is my take on it. The first problem is the Python editor available on  https://www.microbit.co.uk/  does not seem to work with the radio API. One solution to this is to change to the  mu  editor. Two pieces of code are needed. Sending Code for the 'remote' control: Essentially it is set up to send two messages, via the built-in radio module,  spinl  or  spinr  depending on which button is pressed. import radio from microbit import button_a, button_b radio.on() while True:    if button_a.is_pressed():        radio.send('spinl')    if button_...