AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Shapes from different inputs

Week 28 · Unit 12: Be an artist · 3 lessons
2

Shapes made of lights

Computing 4: Unit 12, pp. 168–179
GoalDesign shapes on the 5 × 5 display, write them as rows of 1s and 0s and count how many lights each uses.
New words
LED · a tiny light on the boardrow · a line of lights going across the displaycolumn · a line of lights going down the displayshow leds · a block that lights up the pattern we choose on the display
Explanation

The display of a micro:bit has 25 LEDs in 5 rows and 5 columns. A shape is made by switching some of the LEDs on. In the show leds block, every row has five boxes. A filled box is a light that is on. We can also write a shape as five rows of five digits: 1 means on and 0 means off. A smile, for example, is 00000, 01010, 00000, 10001, 01110. To find how many lights a shape uses, count the 1s. Plan a shape on squared paper first. Then copy it into the show leds block.

show leds
Worked examples
ABsmall diamond: 4 lights
This small diamond is written as the rows 00000, 00100, 01010, 00100 and 00000. Count the 1s: 0 + 1 + 2 + 1 + 0 = 4 lights.
ABbig diamond: 8 lights
A bigger diamond is only a ring of lights. Its rows are 00100, 01010, 10001, 01010 and 00100. The count is 1 + 2 + 2 + 2 + 1 = 8 lights.
ABtriangle: 10 lights
A triangle. Its rows are 00100, 01010, 10001, 11111 and 00000. The count is 1 + 2 + 2 + 5 + 0 = 10 lights. The last row is all off, so the triangle sits at the top of the display. We could move it by changing which rows are on.
Class activity

Light designer (with family): draw five squares of 5 × 5 on squared paper. Colour in the boxes to make a shape in each one, such as a letter, an arrow, a house or a tree. Write each shape as five rows of 1s and 0s, and count the lights. Swap your row codes with a partner. Can they draw your shapes from the code only? Which shape uses the fewest lights? Which uses the most?

Practice
1
How many lights are on in this letter E?
ABletter E
2
Write the five rows for a solid rectangle, 3 lights wide and 4 lights high, in the top left corner of the display. How many lights does it use?
?????????????????????????ABdraw a 3 × 4 rectangle
3
The picture shows an arrow that points up. Row 3 is hidden. Work out the missing row.
?????ABup arrow
4
A small plus needs only 5 lights: one in the middle and four around it. The big plus from the lesson uses 9. How many fewer lights does the small plus use?