1. Please post a note if you have a microbit or are interested in getting one to use with ultibo.
2. https://github.com/markfirmware/prototy ... 09.11.0130
I will add $25 to my ultibo forum sponsorship in honor of the first person who tries this. You need a microbit and an rpi3b or 3b+ or zerow.
Button presses are broadcast without any feedback (open loop) and can be lost. I put a button event history in each packet as an error correction code so that ultibo can correct lost broadcasts. The history is implemented in the packet, I haven't yet implemented the ultibo error correction.
I'd like to make sure that at least one other person can work with the microbit before I go further.
Thanks,
Mark
microbit as ultibo peripheral
Re: microbit as ultibo peripheral
Hi Mark
Downloaded the compiled version and copied to SD Card.
Copied the HEX file to the Microbit
Pressed the buttons and saw the events on the Ultibo screen.
You do have to press the buttons slowly as if you press them too quickly, you only receive the Release.
Well Done.
Regards
Paul
Downloaded the compiled version and copied to SD Card.
Copied the HEX file to the Microbit
Pressed the buttons and saw the events on the Ultibo screen.
You do have to press the buttons slowly as if you press them too quickly, you only receive the Release.
Well Done.
Regards
Paul
Re: microbit as ultibo peripheral
Super. The next version will include timing info in the packet (time between button events) and of course use the history to prevent event loss. Mark.pjde wrote:Hi Mark
Downloaded the compiled version and copied to SD Card.
Copied the HEX file to the Microbit
Pressed the buttons and saw the events on the Ultibo screen.
You do have to press the buttons slowly as if you press them too quickly, you only receive the Release.
Well Done.
Regards
Paul
Re: microbit as ultibo peripheral
Yippee, it works even on old Pi 3B.
Yep, need to hold the button down until the message is sent otherwise only the release message shows on console.
The event count is correct though, down is odd number, release is even.
Both buttons is another event
You got this working quick, well done.
Makes Pi's gateways now for BLE stuff.
Add buttons to a Pi Zero W to make it the Microbit?
Going to have get some more Microbits and some of those nRF51822 tiny PCBs.
Hey, BLE DCC train controllers?
Tiny bots?
Yep, need to hold the button down until the message is sent otherwise only the release message shows on console.
The event count is correct though, down is odd number, release is even.
Both buttons is another event

You got this working quick, well done.
Makes Pi's gateways now for BLE stuff.
Add buttons to a Pi Zero W to make it the Microbit?
Going to have get some more Microbits and some of those nRF51822 tiny PCBs.
Hey, BLE DCC train controllers?
Tiny bots?
Re: microbit as ultibo peripheral
https://github.com/markfirmware/prototy ... 09.12.0337
Ok, I didn't yet add the time duration for the events, but I did use the history in the packet to prevent event loss. I went back to the store and bought the other two microbits that were on the shelf. The ultibo program processes multiple microbit peripherals now. I can't get a lost event using my two thumbs. I'll add a power-on-test mode to the microbit to do stress transmits to see if that can invalidate the proof of concept.
No events are lost but there is some propagation delay. That needs to be measured. There are timing parameters to be tuned in the microbit advertising and the ultibo scanning. More parameters are: how busy is the ble spectrum, how many microbits, how many ultibos.
The log file is the only output. I'll break a unit out of the lpr to provide an event stream and then we can implement something with graphics.
FYI fpc can be used to program the microbit, although I won't be doing it myself any time soon. http://wiki.freepascal.org/micro:bit
The microbit can advertise (used here to broadcast button state) and can accept connections. I have yet to confirm that it can scan for other ble devices and/or initiate a connection to them. However, accepting connections permits a hub to connect for more secure, structured, reliable, and efficient communication versus broadcasting.
With some usb driver support, ultibo should be able to flash over usb new hex files to the microbit. Over the air update might also be possible. The microbit presents a serial/usb interface which might be helpful later.
So what manual input options are there?
The more input used, the more clever the encoding that is needed to fit the data into the packet, in a lossless over broadcast way.
For a game or such, finely-grained tilting might be the ticket.
Mark
Ok, I didn't yet add the time duration for the events, but I did use the history in the packet to prevent event loss. I went back to the store and bought the other two microbits that were on the shelf. The ultibo program processes multiple microbit peripherals now. I can't get a lost event using my two thumbs. I'll add a power-on-test mode to the microbit to do stress transmits to see if that can invalidate the proof of concept.
No events are lost but there is some propagation delay. That needs to be measured. There are timing parameters to be tuned in the microbit advertising and the ultibo scanning. More parameters are: how busy is the ble spectrum, how many microbits, how many ultibos.
The log file is the only output. I'll break a unit out of the lpr to provide an event stream and then we can implement something with graphics.
FYI fpc can be used to program the microbit, although I won't be doing it myself any time soon. http://wiki.freepascal.org/micro:bit
The microbit can advertise (used here to broadcast button state) and can accept connections. I have yet to confirm that it can scan for other ble devices and/or initiate a connection to them. However, accepting connections permits a hub to connect for more secure, structured, reliable, and efficient communication versus broadcasting.
With some usb driver support, ultibo should be able to flash over usb new hex files to the microbit. Over the air update might also be possible. The microbit presents a serial/usb interface which might be helpful later.
So what manual input options are there?
- two buttons
- 3 touch buttons
- coarsely-grained tilt left/right/up/down/none can be a 5 state shift key
- shake
- compass (manual rotation)
- thumb over thermometer to increase measured temparature?
- thumb over the led array to modulate the ambient light measurement?
The more input used, the more clever the encoding that is needed to fit the data into the packet, in a lossless over broadcast way.
For a game or such, finely-grained tilting might be the ticket.
Mark
Re: microbit as ultibo peripheral
That's working better.
Nice find for Microbit/FPC.
The next genchip nRF52832 has much more memory, should make FPC on it even more useful.
Microbit as RC controller for Zero W combat bot?
Wireless game controller, same code?
Hey just remembered, my old walking bot project needed an accelerometer.
Need more Microbits.
Nice find for Microbit/FPC.
The next genchip nRF52832 has much more memory, should make FPC on it even more useful.
Microbit as RC controller for Zero W combat bot?
Wireless game controller, same code?
Hey just remembered, my old walking bot project needed an accelerometer.
Need more Microbits.
Re: microbit as ultibo peripheral
Low cost SWD programmer for those BLE pcbs and other ARM chips?
https://www.tindie.com/products/Electro ... -debugger/
https://www.tindie.com/products/Electro ... -debugger/
Re: microbit as ultibo peripheral
Nice work Mark.
From the Schematics page on the microbit website it indicates that the device implements a Mass Storage Class interface (ie a USB drive) which is already fully supported by the Ultibo drivers, it also says that the serial port is presented as a CDC device which also has a supported Ultibo driver.
Based on that there is a good chance that all of the necessary USB support is already available, anyone like to plug the USB into an Ultibo project and see what is reported?
mark wrote:With some usb driver support, ultibo should be able to flash over usb new hex files to the microbit. Over the air update might also be possible. The microbit presents a serial/usb interface which might be helpful later.
From the Schematics page on the microbit website it indicates that the device implements a Mass Storage Class interface (ie a USB drive) which is already fully supported by the Ultibo drivers, it also says that the serial port is presented as a CDC device which also has a supported Ultibo driver.
Based on that there is a good chance that all of the necessary USB support is already available, anyone like to plug the USB into an Ultibo project and see what is reported?
Ultibo.org | Make something amazing
https://ultibo.org
https://ultibo.org
Re: microbit as ultibo peripheral
Duh! must be getting old, that's how how you update the Microbit's code, just drop the file onto the MSD.
Pi B+'s can handle 4 Microbits via USB
Thanks Garry.
Hmm interesting to try Zero's, may need to grab some USB connectors and make some tiny cables.
Microbit's can do SPI, USB LCD drivers? Wish they had a less silly IO connector.
Pi B+'s can handle 4 Microbits via USB

Thanks Garry.
Hmm interesting to try Zero's, may need to grab some USB connectors and make some tiny cables.
Microbit's can do SPI, USB LCD drivers? Wish they had a less silly IO connector.
Re: microbit as ultibo peripheral
Ultibo wrote:Nice work Mark.
Thanks.
USB 2.0 full speed DAPLink CMSIS-DAP vid 0D28 pid 0204Ultibo wrote:Based on that there is a good chance that all of the necessary USB support is already available, anyone like to plug the USB into an Ultibo project and see what is reported?
This is an embedded on-device monitor for development.
See https://github.com/ARMmbed/DAPLink - I only glimpsed the readme but it is a composite usb interface. Mark.
Who is online
Users browsing this forum: No registered users and 1 guest