2. Other Projects‎ > ‎Micro:Bit‎ > ‎

Lift Me Up

posted 17 Dec 2016, 06:13 by Andy Lakin-Hall

Here's a little code that makes an arrow appear on the matrix when the micro:bit is lifted up. I haven't worked out a way of getting a good html version of this, so I've just done a screen grab.

This code started in the block editor, but I used the convert function to see the code.

Compiling

Once the code is finished, there is a handy COMPILE button, which creates a .hex file to download.

The first problem I had was I couldn't get the laptop to recognise the micro:bit. The device was powered from the USB, but the laptop wouldn't recognise it. After a while I worked out that the USB lead I had grabbed was power only, and didn't include the data lines. Once I swapped this for a proper lead the laptop recognised the micro:bit as a drive straight away.

I read that the micro:bit can be used as a USB storage device, and there are two files there already; a DETAILS.TXT file, which gives the technical details about the device, and a .HTM file which links you to the micro:bit website.

Now I found that if the micro:bit was plugged into the USB port I could save my compiled .hex file directly to the device. You can't actually see the .hex file, and I read that you can only have one .hex file on the device at a time.

The problem I found was when I tried to drag and drop the .hex file to the device. I would get an error window and a FAIL.TXT file appears in the micro:bit.

I wondered if there was a problem with where I was saving the file; some mystery problem because of dropbox or something. But the problem recurred no matter where I saved the hex file apart from directly to the micro:bit.

Eventually I read somewhere that you have to disconnect the micro:bit after drag-dropping a hex file. So once I tried that everything worked as expected. So I can store my download hex files on dropbox and share them here,

Comments