• avitcreates@gmail.com

Hogwarts Sorting Hat!

Hogwarts Sorting Hat!

Sharing is caring!

Hogwarts Sorting Hat using the Micro:bit!

Another job well done! The workshop went really well at the Coder Dojo Kingston University – Saturday 24th February 2018. This one was called “Hogwarts Sorting Hat”. The objective was to craft a sorting hat like the one in Harry Potter then to code it with the Micro:bit to make it glow, think and decide on which Hogwarts house the wearer should be in. The hats didn’t look quite the same as the one in the Harry Potter films but they had the same concept.

In preparation, I marked out templates for the cone & the brim of the hats, so all the attendees needed to do was carefully cut them out and stick the bits together (this saved lots of valuable time on the day). I also provided some materials & made a worksheet with instructions.

I was pleased that everybody seemed to be doing fine on their own with the construction part of the hat. The part of the activity most people struggled with was the code. The main issue was that not all the neopixels were the same spec, so slight variations in the code were needed in some cases. I was very happy to help out or prompt the attendees when they got stuck.

How the Sorting Hats worked: The Micro:bits were coded, so when shaken they’d randomly select a number from 1 – 4.  Each number was coded to be a trigger which made the neopixel strip emit a different colour.  The different  colours represented the four houses: Gryffindor; Hufflepuff; Ravenclaw and Slytherin. The Micro:bit LED matrix was coded to show the initial of the chosen house.

Overall, it all went well and I am already thinking of some ideas for the next Dojo!




Hi, my name is Avye and I love making, coding, designing, exploring new technology and swimming! This site is about the things I get to experience, discover and enjoy. Welcome to my world!

Leave a Reply