lørdag den 27. oktober 2018

The Bluetooth radio in BBC micro:bit

The BBC Micro:bit has caught my attention. Last month, I described a morse trainer with the micro:bit. Since then I've played with the integrated radio (a micro:bit term), which is a
Bluetooth Low Energy (BLE) transceiver. It can connect two or more micro:bits via Bluetooth. You can connect a micro:bit to a smartphone if the right app is installed. You can even create software on the smartphone and download it into the micro:bit via Bluetooth!


The BBC micro:bit (component side). 
Picture credit: microbit.org

The following project shows a morse transceiver. It can send dots and dashes to one or several micro:bits. Each micro:bit runs the same software.

Here is the coding in the Blocks Editor:

Function of button A and button B.

The radio channel is set to 10 when the program starts. If the user clicks the A button, 0 is transmitted and will sound as a dot on the receiving micro:bit. If button B is pressed, a 1 is sent and it sounds as a dash in the receiving end.

Function of the receiver.
When the micro:bit receives a number, it is decoded in the "on radio received" block. If a 0 was received, a dot will sound using "play tone for 200 ms". If  a 1 was received, a dash will sound using "play tone for 600 ms".

The morse transceiver is demonstrated in this video (Danish language):

73 from OZ1BXM Lars Petersen
Homepage: oz1bxm.dk