π Unit Overview
- You will learn to write programs for the GAME ZIP 64 controller
- Develop a range of physical computing solutions using a micro:bit
- You will use a selection of input and output devices to create a Snake game
π― Learning Objectives
Develop theΒ Programming & Development, Hardware & Processing Learning Strands:
- Understand what a micro:bit is
- Understand how to use the MakeCode website
- Design, use and evaluate computational abstractions that model the state and behaviour of real world problems and physical systems
- Be able to explain RGB colours with some examples
π¬ Key Vocabulary
- micro:bit
- Program
- LED
- Input
- Output
- RGB
- Blocks
- GAME ZIP 64
π Starter Activity – RGB Colours
We are going to build a game using a new piece of hardware. We will build up the skills over the next few lessons for you to be able to create this game. In this lesson we will be controlling the lights on the GAME ZIP 64 controller.
- Pick up a controller and look closely at a single LED. Can you see three different squares inside each white square? They are very tiny! Each one is a different colour: Red, Green and Blue or RGB.
- The micro:bit sends 3 numbers to each light, a value between 0 and 255, for each colour.
- This is because an 8 bit binary number is used, such as 10101101. 8 bits can represent a number from 0 to 255 in denary.
- Look at the RGB values on the right, what colours do you think each row will make?
- Select the table by dragging your cursor from the top left to the bottom right and they copy it into a blank Word file.
- Also answer this question after the table – What is the total amount of colours we can represent?
Red | Green | Blue | Colour? |
---|---|---|---|
255 | 0 | 0 | |
0 | 0 | 255 | |
255 | 255 | 0 | |
100 | 0 | 0 | |
0 | 255 | 255 | |
255 | 0 | 255 |
π The GAME ZIP 64
- The GAME ZIP 64 has a variety of inputs and outputs.
- In your word file from the starter activity list the inputs and outputs you can see in the diagram.
- Let’s see what these LEDs look like lit up on the 8×8 display.
- As there are 8 LEDs across and 8 LEDs down we know there are 64 different LEDs.
- You can see that they each have a number next to them on the GAME ZIP 64. They start at 0 in the top left to 63 in the bottom right.
- Why do you think it starts at 0 and not 1?
- Go to makecode.microbit.org
- Click “New Project” and name it “L1 GAMEZIP 64”.
- Go to Extensions and then search for “game zip”, click on the block that appears.
- Then find the blocks so your code matches the screenshot.
- Connect your micro:bit and download your code onto it. Plug the micro:bit into the top of the GAME ZIP 64 and turn it on.
π Silver/Gold/Platinum – Challenges
To get the badges for this lesson you must complete an amount of challenges from the list below:
Challenge 1
When I press button A: All the lights will go to an RGB code that Iβve chosen.
Challenge 2
When I press button B:
Light 1 will go red
Light 17 will go blue
Light 25 will go green
Light 32 will go a different colour
Use the code on the right to help you.
Challenge 3
Draw Pacman on the screen like the image on the right.
Challenge 4
In challenge 3 you drew some straight lines. We can save time by coding these straight lines using variables and a loop.
We want to colour in the line 24 to 30 yellow. Use the pseudocode below to help you make this:
Set temp to 24
Loop 7 times:
Set pixel temp to yellow
Change temp by 1
Challenge 5
Make an animation by showing an image, then clearing the screen and showing a new image. This should happen in a loop.
Challenge 6
Make an interactive animation by showing an image, then depending on which button the user presses it should clear the screen and show a new image. This should happen in a loop.
In this lesson, you…
- Used the GAME ZIP 64 for the first time and looked at it’s inputs and outputs.
- Created your first programs using the GAME ZIP 64.
- Used RGB colours to light up the screen in different patterns.
Next lesson, you willβ¦
- Look at how to use inputs to control the lights on the screen.
- Use variables and if statements (selection) to control logic for a game.
π Badge it
π₯ Silver Badge
- Upload 2 screenshots showing code for 2 challenges to Bourne to Learn.
π₯ Gold Badge
- Upload 4 screenshots showing code for 4 challenges to Bourne to Learn.
π₯ Platinum Badge
- Upload 6 screenshots showing code for 6 challenges to Bourne to Learn.