Sending BLE message from microbit


I’ve been looking at the voice activated microbit example, and I think it should work well for something I want to do.

I want to use the microbit to detect a sound, and when the sound is detected, activate the microbit’s speaker and send a message using BLE.

Any tips of where in the microbit example code to look, and which changes to make to realize this solution?

All help is greatly appreciated! Thanks!

Hi @mathias take a look at the other examples in that repository (not by us, but by the microbit team):

  1. - playing something over the speaker.
  2. - Driving the radio.

Knowing the microbit a little you can probably just combine these APIs, so at the place where we display the smiley just throw the speaker code in and try if it works.

Thanks, @janjongboom!

I’ll check it out.

@janjongboom, do you know if it is possible (or how to make it possible) to build and flash the voice activated microbit example using west instead of the python build file?

I currently have a bluetooth UART example that works on the microbit, but as the two examples build and flash in two different ways I’m very unsure of how to merge them.

Hi @mathias, not as far as I know as it’s not based on Zephyr, but on Codal instead. Maybe is a better place for this, I’ve only done the porting of the microphone code.

I understand. Thank you for your reply, @janjongboom! :slight_smile: