What are 'coordinates'?
Coordinates are a set of numbers that show the exact position of something. You might have learnt about coordinates in Maths already. If so, you would have heard about the x and y-axis.
The x-axis is the line that goes across (or horizontal)
The y-axis is the line that goes down (or vertical)
When you learn about this in Maths, it will look like the following:
When we have a set of coordinates, they tend to include an x and y coordinate. If the x coordinate was 4 and the y coordinate was 1, we would see it written like this: (4,1).
What do you notice about this? Well, the x-coordinate is always written first, followed by the y-coordinate. Just like with the alphabet, x comes first and is followed by y.
We will use coordinates in this micro:bit lesson. However, with micro:bit, the layout of our screen will look different to the above (or Maths class), particularly the y-axis. So, our micro:bit coordinates are laid out like this:
With this diagram of the micro:bit, the red square is at the coordinate (1,2). Based on this, can you try our unplugged challenge below.
Try this out at home:
What you will need: Paper, pen, markers
1) Draw out a 5 x 5 grid like the below (remember the micro:bit has 25 LED lights). This grid represents those lights.
2) Once this is done, use different markers to colour in the following coordinates. (Remember, in the article above, the grid had numbers and a red square at (1,2). Our x-coordinate was 1, our y-coordinate was 2. Use this knowledge to help you here.)
(a) Colour in (0,0)
(b) Colour in (2,2)
(c) Colour in (0,4)
(d) Colour in (3,0)
(e) Colour in (4,4)
When done, check your answers in the PDF below.
Well done! Now that you have practiced coordinates, you should be easily able to create your own game using the LED lights and the coordinates of these lights. Watch the below to begin your game.
Fantastic work. For your home challenge, the DreamSpace team want you to build on the game that they have begun here by adding some more blocks of code. Game On!