I have added examples here written in C++ using the Arduino IDE. The main reason for this is to free up memory on the Micro:Bit to allow us to create more complex code. Arduino IDE was not designed for Micro:Bit so after installation it is necessary to make some changes; this is easy and will take no longer than 20 minutes. Instructions on how to do this can be found at the following link, https://www.l33t.uk/bitbot/?page_id=496.
These are examples and not full tutorials I will list all dependencies and links to where the libraries can be downloaded from at the top of the code for each tab. I will use tabs in Arduino IDE to make the code easier to read, because of this when downloading the code examples you will have multiple .ino files. Opening any one of these will open all of the tabs in the IDE.
My aspiration is to include most of this code in a single Bit:Bot library with good quality documentation that will enable users to create code for the Bit:Bot or any robot in fact and have a lot of the utility code hidden away.
IMPORTANT: Before the Arduino IDE examples will work you must upload the S110 Softdevice onto your Micro:Bit, if you don’t the code will not work. This is because when MicroPython code is uploaded this softdevice is removed. Everytime you upload MicroPython code to the Micro:bit the softdevice will have to be re-uploaded to the Micro:bit BEFORE uploading new Arduino code. If your Arduino code doesn’t work correctly upload the softdevice then re-upload your code and hopefully that will fix any issues. The softdevice can be downloaded from the resources section or the following link microbit-adv.