Learning Outcome

At the end of this lesson, you will be able to:

  • understand how to make the Micro:Bit loop over a 2-bit binary number


  • go over 1-bit number
  • loops


  • you will now have 4 different states on 2 different pins to take care of
    • you can no long just use A button pressed or not
    • you will need to use a loop


  • go over a 1-bit number using a loop (see below)

Daily Assignment

  • first get the 1-bit code and circuit working on your breadboard with LEDs
  • next convert the code to a 2-bit number
    • note:
      • you will need a loop inside your first loop
      • you will need a second variable for the twos column
      • you should have 4 different states


  • can you update your code for 2 3-bit numbers?
    • a_input and b_input