Blocks for read/write BLE characteristics of an external device
Hi I would like to be able to control a LEGO Boost (or LEGO wedo/Spike) Hub with Micro:bit. The hub connect via bluetooth Low Energy (BLE). Makecode for Micro:bit allows to send/receive messages through UART on BLE, but the LEGO hub doesn't support UART. The hub only support direct BLE characteristics writing/reading. You can find here an example of the messages that we need to be able to send: https://github.com/JorgePe/BOOSTreveng So, is it possible to add blocks on makecode that would allow to directly read/write BLE characteristics of an external device ? after that, it would probably be easy to make an extension or custom functions to make the integration between micro:bit and LEGO Hubs, and probably many other integrations (sorry if my request is stupid, i'm totaly newbe)
I am not a BLE expert. @martinwork @carlosperate any ideas? Is this possible?
Hi @Flangad, I don't know about LEGO Boost, but the answer in https://github.com/JorgePe/BOOSTreveng/issues/39 sounds right.
By default, micro:bit works as a Bluetooth peripheral. Two peripherals cannot connect to one another. Search online for "bluetooth central vs peripheral".
Building micro:bit software in C++ to support the central role is an advanced task. https://github.com/lancaster-university/codal-microbit-v2/issues?q=is%3Aissue+is%3Aopen+central
Perhaps have a look at MIT App Inventor to create a phone/tablet app to talk to both peripherals? Search for "mit app inventor micro:bit uart" and "mit app inventor lego boost".
This looks interesting! https://www.facebook.com/groups/SPIKEcommunity/posts/spike-prime-remote-using-microbit-v2-its-also-possible-and-the-remote-code-and-f/1349366148774947/
OK, thx for your answer.. not really good news. LEGO PoweredUP (last generation) angular motors are great because
- they are stepper motors : they act like both DC "continuous" motor and Servo "angular" motors, but also as sensors that send their anglular position to the controler,
- and of course they are integrated with the great LEGO Technic construction system But they have proprietary interface and connector, and can connect only to LEGO Spike/Mindstorm (last generation)/Boost hub
So maybe the only "clean" solution to get those great motors controled by micro:bit would be to find an electronic hardware manufacturer who develop an interface module that could connect one side I2C/grove to microbit and other side directly connect 2/4 or 6 Lego PoweredUP Motors with their specific connectors. I understand this would be a more serious path than trying to establish a bluetooth connection between micro:bit and LEGO poweredUP HUB.
Question answered.