GRADE 7 · COMPUTING · UNIT 6 · LESSON 6.8

Sequencing and pattern recognition: Getting the message across

Creating a moving sequence of lights

Read a little. Try the workbook. Check your answers. Choose one section below to get started.

7 fillable worksheet pagesRead at your own pace

LET’S TRACE, REASON AND TEST

Creating a moving sequence of lights

A frame is one image in an ordered sequence. Different fixed LEDs switching on and off can suggest movement. The order, delays and final display state are all part of the program's behaviour.

Today’s two goals
  • Plan two successive LED images as an ordered flowchart.
  • Encode both images and insert a delay expressed in milliseconds.
Original PaxaKids illustration for Creating a moving sequence of lights. Precise program text and data are supplied in the workbook models.
An original PaxaKids workbook scene. Use the supplied programs and data for precise workbook facts.

Explore the clues

Tap one card to find out more.

Understand the idea

A frame is one image in an ordered sequence. Different fixed LEDs switching on and off can suggest movement. The order, delays and final display state are all part of the program's behaviour.

Concept to practise: Creating a moving sequence of lights.

Work through an example

Show the left column, wait 500 milliseconds, show the right column and wait again. Without a later clear call, the final right-column image can remain visible even though this finite sequence has ended.

Try before your workbook

For a top-row then bottom-row sequence, what should you check besides whether both images appear at some point?

Check my readiness thinking

Check that the top row appears first, the bottom row second, the five digits in each row are correct and both requested waits are present. Record whether the final image remains or is explicitly cleared; those are different requirements.

Your original programs and learning models

These original PaxaKids program and data models support your workbook. Some examples deliberately contain faults to investigate. Follow their headings and preserve exact code case, punctuation and order. Traces and supplied records are not claims of physical testing.

Create apparent movement with successive images

A frame is one image in a sequence. Changing which LEDs are lit can make a line appear to move. The LEDs remain fixed in the board; different positions turn on and off.

Order and timing matter. A long pause may look like two separate displays, while very brief frames may be hard to recognise. Evaluate the result for the intended user.

Compare two vertical-line frames

This complete original example shows the left column, then the right column. The string uses colons to separate five rows. A variable name refers to each Image before the output calls use it.

Each five-by-five table gives exact LED brightness digits: 0 is off; 9 is maximum. Rows run top to bottom and columns left to right.

First: left column
Row / column12345
190000
290000
390000
490000
590000
Second: right column
Row / column12345
100009
200009
300009
400009
500009
Original program model
from microbit import *

frame_1 = Image("90000:90000:90000:90000:90000")
frame_2 = Image("00009:00009:00009:00009:00009")

display.show(frame_1)
sleep(500)
display.show(frame_2)
sleep(500)

Read the finite sequence plan

The final wait is a pause before completion. It does not automatically clear the display. With no clear call, the last image can remain visible after the program’s finite sequence has ended.
  1. Start
  2. Show left-column frame
  3. Wait 500 ms
  4. Show right-column frame
  5. Wait 500 ms
  6. Stop

Prepare the horizontal targets and starter

In the practical, replace the two all-off frames in HorizontalPattern_Paxa.py with these top-row and bottom-row targets. Keep the first output before the second and preserve both waits.

Each five-by-five table gives exact LED brightness digits: 0 is off; 9 is maximum. Rows run top to bottom and columns left to right.

Frame 1: top row
Row / column12345
199999
200000
300000
400000
500000
Frame 2: bottom row
Row / column12345
100000
200000
300000
400000
599999
ORIGINAL STARTER: BOTH FRAMES ALL OFF
from microbit import *

frame_1 = Image("00000:00000:00000:00000:00000")
frame_2 = Image("00000:00000:00000:00000:00000")

display.show(frame_1)
sleep(500)
display.show(frame_2)
sleep(500)

Check order, duration and completion

Test the sequence after startup or reset. First check the lit positions, then the order, then the requested waits and the final retained image. Use an appropriate timing observation and record its limits.

For a separate clear-at-end version, add display.clear() after the second wait. Keep it separate from the required version so that both behaviours can be explained.

Practice files for this lesson

Save a copy of these original PaxaKids learner files before editing in suitable software. Some code and datasets deliberately need completion or repair. Downloading a file does not run it. Use invented data; record actual tests separately from predictions. Native software practice files are not print-optimised; use the student PDF for printing.

Paxa the Fox

Try one step with Paxa!

Use supplied fictional records. Do not disclose personal details, upload private photos or bypass browser warnings to complete an activity. Save personal responses before leaving.

Our Unit 6 learning path
  1. Lesson 6.1: Prototyping
  2. Lesson 6.2: Pattern recognition
  3. Lesson 6.3: Patterns between text-based programming languages
  4. Lesson 6.4: Boolean selection and sub-routines
  5. Lesson 6.5: Project plans and test plans
  6. Lesson 6.6: Identifying errors and debugging
  7. Lesson 6.7: Sequences and lights
  8. Lesson 6.8: Creating a moving sequence of lights
  9. Lesson 6.9: Extending a light sequence
  10. Lesson 6.10: Light brightness
  11. Lesson 6.11: Loading-screen and name-sequence extensions
  12. Lesson 6.12: Final project: Sound-triggered visual alarm
  13. Lesson 6.13: Evaluation
  14. Lesson 6.14: What can you do?
For grown-ups: using this lesson

Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.

Read one explanation, discuss the model and try the readiness check before the workbook. Choose “Mark lesson finished” when ready. Optional account progress saves lesson position and completion across devices; save personal responses before leaving.

2. Fill in your workbook

Read the teaching and the complete workbook instructions. Choose, write or draw; Answer list offers larger controls. Trace code precisely and distinguish predictions from actual tests. Review designs, explanations and drawings with a grown-up.

Creating a moving sequence of lights7 student pages · original artwork

Opening your PDF…

Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.

TAKE YOUR PRACTICE OFFLINE

3. Download the student worksheet

All 7 original A4 student pages, ready for pencil-and-paper practice. Choose Review Answers to check your work on this webpage.

Student worksheet only · PDF · 8.3 MiB · No answer key included

Download worksheet PDF ↓

TRY FIRST, THEN CHECK TOGETHER

Download the student worksheet →

4. Answers & guidance

Finished your try? Open the guide and compare one worksheet at a time. Your own words may be different and still explain the right idea.

Shown on this webpage only. There is no answer-key download, and this guide is left out when printing the page.

Show answers for all 7 worksheets

Worksheet 1

  1. Question 1: What physically moves across the board in this activity? no LED moves; different positions light up
  2. Question 2: Which elements define the planned animation? the ordered frames and their timing

Worksheet 2

This page introduces the activity. There are no marked responses on this sheet.

Worksheet 3

  1. Question 3: What remains visible after this example finishes? the right-column image

Worksheet 4

This page introduces the activity. There are no marked responses on this sheet.

Worksheet 5

  1. Question 4: How many milliseconds represent half a second in microbit sleep()? 500
  2. Question 5: What is the total requested pause time for two 500 ms waits, in milliseconds? 1000
  3. Question 6: Which call clears the final image explicitly? display.clear()

Worksheet 6

  1. Question 7: Discuss the horizontal targets with a partner. Draw a flowchart that shows the top row only, waits half a second, shows the bottom row only, waits half a second and stops. Encode both complete five-by-five grids in the code area, or identify an attached grid plan. Label the output order and waits. State what remains visible when this finite sequence ends. Top grid rows99999,00000,00000,00000,00000; bottom grid rows00000,00000,00000,00000,99999. Both include every off cell. Flowchart uses Start, top-row output,500ms process, bottom-row output,500ms process, Stop, with arrows in order. It has no clear call, so the bottom image remains visible after completion. Two full grids or identified attachment and actual partner discussion or Pending. Human row/column labels are1–5; digits are brightness settings. No numeric scores. Grown-up review; personal evidence is required.

Worksheet 7

  1. Question 8: Edit HorizontalPattern_Paxa.py to match your plan, save it, connect and flash a compatible micro:bit. Record expected and actual frame positions, order, timing and final retained image, with the method/revision and any repair/retest. Discuss with a partner why several images might help a visual alarm and what user evidence is still needed. Identify any optional clear-at-end version separately. Mark unavailable practical or discussion steps Pending. Original horizontal reference must show top row only, sleep500, bottom row only, sleep500, then retain bottom image. Compare all25positions in each frame. Require actual source revision, editor/transfer and board observations or honest Pending; simulator and controlled stub evidence distinct. Timing observations identify their method and limits. Optional clear version clears only after the second wait and is labelled separately. Discussion covers apparent movement/attention, legibility, suitable timing and intended-user evaluation; no claim several images guarantee notice or accessibility. Record partner/date or Pending. All three source activities retained; no numeric scores. Grown-up review; personal evidence is required.
Back to my workbook ↑

Curriculum & workbook reference

Computing for your homeschool day

Explore Creating a moving sequence of lights with this free Grade 7 Computing lesson. Read one idea together, try the fillable workbook and return to review at your own pace. Download the same student worksheet PDF for pencil-and-paper practice.

Fit learning around your family’s day. There is no timer and no sign-up is needed to use the lesson. An optional account saves your lesson position and completion across devices. Workbook responses and drawings stay in this tab; save a copy of your responses before leaving.

Understand your results

Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.

Choose Review Answers after trying the activity. The guide stays on the webpage; the worksheet download contains only the student pages.

For programme background, visit the Cambridge Lower Secondary Computing overview. PaxaKids provides independent original companion practice.

The book pages identify the related teaching topic. The explanations, characters, programs and exercises here are original PaxaKids companion practice. Practical tasks require the appropriate editor and, where applicable, suitable equipment. A design or paper trace is not a verified hardware result. Only completed, reviewed lessons are listed.

Explore the Cambridge Lower Secondary Computing curriculum for programme background. PaxaKids is an independent learning resource.