My Cart:

0 item(s) - £0.00
You have no items in your shopping cart.


Get Started With Zip Halo For The BBC microbit

This is a short guide to help you get started with ZIP Halo for the BBC microbit. The techniques we cover will help to form the basis of your own coding adventures as you put ZIP Halo to work in your projects.


This basic guide will show you how to light up individual LEDs, before moving onto how you might animate the display for something a little more interesting (as shown in the image above).


Get Started With ZIP Halo For The BBC microbit:

We Used:


Before we Start:


Head over to the MakeCode Editor. First, we will need to add the NeoPixel blocks to the MakeCode Editor. In the top right of the editor you will see a cog symbol, click this and select 'Add Package' from the menu list. A dialogue box will open (see above), click on the NeoPixels tile to add it to the blocks menu. We are now ready to write some code!


Let's Write Some Code:

In order to better understand how to address an individual ZIP LED, we are going to write code that will light up a single LED.  The code below shows how you might do this.


The above code has two sections; the on start loop and the forever loop. In the on start loop we have a variable called 'ZIP_LED' that contains the information that describes our ZIP LED set up, which on the microbit is being used (P0), how many individual LEDs the Halo has (24) and the LED format (RGB GRB format)).

The forever loop contains the instructions needed to light up an LED of our choosing and give it a defined colour. The first line adds further information to the 'ZIP_LED' variable so that when we include the ZIP_LED show block, the correct LED is lit with the correct colour. We didn't need to put our code into a forever loop, it could have just as easily sat in the on start loop, but as we are going to use the forever loop in the second code example it makes it easier to follow the theme if we don't change it up too much.


What Will Happen:

As soon as we add power to ZIP Halo, LED 12 (6 O'clock) will light up red. Because we put the instructions in a forever loop the light will stay on for as long as the microbit has power.


Animating The ZIP Halo:

Now we are going to demonstrate how we can light up a single LED and make it travel around the ZIP Halo. The embedded editor below shows how we chose to code this.


As you can see in the above code, the code we used in the first example is still being used in this program. We are still using the on start and forever loop, we are still using the 'ZIP_LED' variable that contains the information about the ZIP LED configuration of the ZIP Halo, and we are still lighting up one red LED.

In order to facilitate the movement, we have made use of a second variable called 'item'. In the on start block, we set 'item' starting value to zero as the LED at 12 O'clock on the ZIP Halo is called 0 (zero). So, instead of putting in a numerical value in the first block in the forever loop we use the variable 'item' to determine which LED should be lit up.

We then use an If Then Else loop to increase the value of 'item' by 1, which in turn changes the LED that is lit up, the clear block turns off the current LED as the count cycles to ensure that only one LED is lit up at a time. Once the value of 'item' reaches 24 we reset the value of 'item' to 24 and the process starts again.


What Will Happen:

When the Halo and microbit are powered on, the '0' LED will light up red and then the red LED will move around and around Halo's LEDs until it is disconnected from the power source.

You might be wondering why you might want to learn how to code something like this and if it is of more use than as a decoration. Learning how to do something basic like this that allows you to light up specific LEDs gives you the basis of things like an animated compass or warning light.


Grab The Code:

Once you've downloaded and unzipped the file you can either put it straight onto a microbit or drag and drop it into the MakeCode editor. To put it onto your microbit, connect your microbit to your computer via USB, once connected the microbit will show up as a removable drive that you can drop the hex file straight onto. The light on the back of the microbit will begin to flash, once this stops then the file has finished transferring and the program will begin to run.

← Previous Post Next Post →

6 thoughts on “Get Started With Zip Halo For The BBC microbit”

  • Tony January 3, 2018 at 5:27 pm

    Anyone written code to turn the Halo into a circular digital clock ?
    1 colour led could increment around the circle, taking 1 hour to go around, indicating minutes
    Another colour could increment every hour, indicating the hour.
    Could always do a second's indicator as well.
    Just an idea, for a cleaver programmer.

    • Mark Donnison January 8, 2018 at 10:56 am

      Hi Tony, thanks for the question. It is something we've talked about and, quite often, these talks can result in things. Watch this space!

  • Davor April 12, 2018 at 4:32 pm

    Works great, however there is one little problem. Can not get color with hue/saturation/luminosity block, whichever values I enter always get sort-of white color.

    • Mark Donnison April 16, 2018 at 1:21 pm

      Hi Davor, if you were to email a link to your code and a description of your problem to we will have a look and see if we can get it working for you!

  • Matt July 4, 2018 at 3:44 pm

    Hi there, am having an issue with my new zip halo - I don't seem to be able to get any of the LEDS 13-24 to work. I *have* got my array size set to 24 (and I've checked the code carefully/copied from a variety of online examples).

    Only thing I know I'm not doing right yet is powering with >=3.5v - only have a 2xAAA battery holder right now, so powering with 3v only. Might that be the issue, do you think? Have tried code that lights 1 LED at a time to reduce load, but same result.

    Is there any other test I can do (have a multimeter to hand) to verify hardware before I get in touch with Pimoroni re potentially getting a replacement...?

    Thanks in advance,

    PS love your kits, please keep them coming!

    • Mark Donnison July 5, 2018 at 11:53 am

      Hi Mat, thanks for getting in touch and we are sorry to hear that you are experiencing difficulties with your ZIP HALO. If you could drop our customer services team an email they will help you get to the bottom of your issue:

Leave a Reply