3.4.A - Four Patterns V1
- Connect four pushbuttons to a Bit Board to control four LEDs with code.
- We'll explore how we can use four pushbuttons as inputs for the micro:bit and control four LEDs as the output.
Next
You will need
- 1x Bit Board
- 1x micro:bit
- 4x LEDs
- 4x Push buttons
- 1/8" Maker Tape
- Scissors
Next
Back
Step 1 Connect the Buttons (and LEDs)
If you use a larger baseplate you can space out your components a bit more, but if you're using a small one pay close attention to the tape paths as there isn't room for deviation on a 16x8 baseplate. Notice how the bit board is all the way to the right side. This is the only way to fit all the components.
Next
Back
Step 1 Connect the Buttons (and LED)
- We'll use Maker Tape to connect the four Buttons and the LED to the Bit Board on a LEGO baseplate.
- Connect LEDs to Pin 1, Pin 2, Pin 3, and Pin 4. Connect Buttons to Pin 5, Pin 6, Pin 7, and Pin 8.
- And of course we'll connect the Ground (GND) sides of each component to Ground on the Bit Board.
- You'll notice the Ground on the Bit Board (as well as the LED and other Crazy Circuits components we'll use) is color coded White.
- While the LED has Polarity our Button does not. If you connect it the other way around it will still work fine. Not all components have Polarity.
Next
Back
Step 2 Load the Code
- We'll write four different functions and each can be called by holding down a specific button. Note that you need to press and hold the button. Once you release a button the if is no longer true, so the function stops running.
- We've seen these functions before (in a previous chapter) so they are not new, but now we've got them all together in one single program.
- We need to hold down the button if we want the function to get called repeatedly because there is no loop of any kind in the function, which means it just runs once and then returns.
- We use the word return for what a function does at the end. Sometimes it actually returns a value, and sometimes it returns nothing.
Code Shown on next 2 slides
Next
Back
Next
Back
Next
Back
Step 3 Test it Out!
When you press and hold a button a corresponding function will run. You'll get a different light show depending on the button you press!
Save this circuit for the next assignment!
Back
3.4.A - Four Patterns V1
Teaching and Learning
Created on March 27, 2026
Start designing with a free template
Discover more than 1500 professional designs like these:
View
Microlearning: Enhance Your Wellness and Reduce Stress
View
Microlearning: Teaching Innovation with AI
View
Microlearning: Design Learning Modules
View
Video: Responsible Use of Social Media and Internet
View
Mothers Days Card
View
Momentum: First Operational Steps
View
Momentum: Employee Introduction Presentation
Explore all templates
Transcript
3.4.A - Four Patterns V1
Next
You will need
Next
Back
Step 1 Connect the Buttons (and LEDs)
If you use a larger baseplate you can space out your components a bit more, but if you're using a small one pay close attention to the tape paths as there isn't room for deviation on a 16x8 baseplate. Notice how the bit board is all the way to the right side. This is the only way to fit all the components.
Next
Back
Step 1 Connect the Buttons (and LED)
Next
Back
Step 2 Load the Code
Code Shown on next 2 slides
Next
Back
Next
Back
Next
Back
Step 3 Test it Out!
When you press and hold a button a corresponding function will run. You'll get a different light show depending on the button you press!
Save this circuit for the next assignment!
Back