GRADE 7 · COMPUTING · UNIT 6 · LESSON 6.9
Sequencing and pattern recognition: Getting the message across
Extending a light sequence
Read a little. Try the workbook. Check your answers. Choose one section below to get started.
LET’S TRACE, REASON AND TEST
Extending a light sequence
Extending a sequence means inserting a frame in the correct position in both the plan and code. Repeated structures help, but copied image definitions, calls and waits all need checking.
- Extend a flowchart and grid plan by inserting an additional image in the correct position.
- Edit repeated code structures while preserving the intended order and delays.

Explore the clues
Tap one card to find out more.
Understand the idea
Extending a sequence means inserting a frame in the correct position in both the plan and code. Repeated structures help, but copied image definitions, calls and waits all need checking.
Concept to practise: Extending a light sequence.
Work through an example
A vertical sequence becomes left column, middle column, right column, with a 500 millisecond wait after each. The middle definition is useful only when its output call is also placed between the other two calls.
Try before your workbook
A program contains the right three images but shows top, bottom, middle. Is adding the middle-frame definition enough to repair the horizontal sequence?
Check my readiness thinking
No. Reorder the output calls to top, middle, bottom, verify the image definitions and check each delay. Save the repaired revision and retest; a program that parses can still have a sequence error.
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.
Extend the sequence without losing its order
You will first plan and create a three-frame horizontal sequence, then inspect an original faulty program and repair it against the same target.
See how the vertical example gains a middle frame
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.
| Row / column | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| 1 | 9 | 0 | 0 | 0 | 0 |
| 2 | 9 | 0 | 0 | 0 | 0 |
| 3 | 9 | 0 | 0 | 0 | 0 |
| 4 | 9 | 0 | 0 | 0 | 0 |
| 5 | 9 | 0 | 0 | 0 | 0 |
| Row / column | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| 1 | 0 | 0 | 9 | 0 | 0 |
| 2 | 0 | 0 | 9 | 0 | 0 |
| 3 | 0 | 0 | 9 | 0 | 0 |
| 4 | 0 | 0 | 9 | 0 | 0 |
| 5 | 0 | 0 | 9 | 0 | 0 |
| Row / column | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| 1 | 0 | 0 | 0 | 0 | 9 |
| 2 | 0 | 0 | 0 | 0 | 9 |
| 3 | 0 | 0 | 0 | 0 | 9 |
| 4 | 0 | 0 | 0 | 0 | 9 |
| 5 | 0 | 0 | 0 | 0 | 9 |
Read the complete extended vertical example
Original program model
from microbit import *
frame_1 = Image("90000:90000:90000:90000:90000")
frame_2 = Image("00900:00900:00900:00900:00900")
frame_3 = Image("00009:00009:00009:00009:00009")
display.show(frame_1)
sleep(500)
display.show(frame_2)
sleep(500)
display.show(frame_3)
sleep(500)Plan the three horizontal targets
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.
| Row / column | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| 1 | 9 | 9 | 9 | 9 | 9 |
| 2 | 0 | 0 | 0 | 0 | 0 |
| 3 | 0 | 0 | 0 | 0 | 0 |
| 4 | 0 | 0 | 0 | 0 | 0 |
| 5 | 0 | 0 | 0 | 0 | 0 |
| Row / column | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| 1 | 0 | 0 | 0 | 0 | 0 |
| 2 | 0 | 0 | 0 | 0 | 0 |
| 3 | 9 | 9 | 9 | 9 | 9 |
| 4 | 0 | 0 | 0 | 0 | 0 |
| 5 | 0 | 0 | 0 | 0 | 0 |
| Row / column | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| 1 | 0 | 0 | 0 | 0 | 0 |
| 2 | 0 | 0 | 0 | 0 | 0 |
| 3 | 0 | 0 | 0 | 0 | 0 |
| 4 | 0 | 0 | 0 | 0 | 0 |
| 5 | 9 | 9 | 9 | 9 | 9 |
Inspect the original faulty three-frame program
Original program model
from microbit import *
frame_1 = Image("99999:00000:00000:00000:00000")
frame_2 = Image("00000:00000:00000:99999:00000")
frame_3 = Image("00000:00000:00000:00000:99999")
display.show(frame_1)
sleep(500)
display.show(frame_3)
sleep(50)
display.show(frame_2)
sleep(500)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.

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
- Lesson 6.1: Prototyping
- Lesson 6.2: Pattern recognition
- Lesson 6.3: Patterns between text-based programming languages
- Lesson 6.4: Boolean selection and sub-routines
- Lesson 6.5: Project plans and test plans
- Lesson 6.6: Identifying errors and debugging
- Lesson 6.7: Sequences and lights
- Lesson 6.8: Creating a moving sequence of lights
- Lesson 6.9: Extending a light sequence
- Lesson 6.10: Light brightness
- Lesson 6.11: Loading-screen and name-sequence extensions
- Lesson 6.12: Final project: Sound-triggered visual alarm
- Lesson 6.13: Evaluation
- 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.
Opening your PDF…
Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.
You’ve completed the checked activities.
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
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
- Question 1: Where should a new middle position be inserted in a left-to-right sweep? between the left and right frames
- Question 2: What must be checked after copying a frame section? its image values, position and delay
Worksheet 2
- Question 3: Which row string belongs in every row of the middle-column frame? 00900
- Question 4: How many distinct frames are planned? 3
Worksheet 3
- Question 5: What is the total requested pause time for three 500 ms waits, in milliseconds? 1500
- Question 6: Does this finite example clear itself after the last wait? no; the right-column image remains
Worksheet 4
- Question 7: Which human row number is lit in Frame 2? 3
- Question 8: How many LEDs are lit in each target frame? 5
Worksheet 5
- Question 9: Which is the intended order of output calls? frame_1, frame_2, frame_3
Worksheet 6
- Question 10: Create your own program for the three horizontal targets on page 4. First draw the ordered flowchart, including each half-second wait and Stop. Encode all five row strings for each frame in the code area or an attached grid plan. Save the complete matching source and identify its filename. Explain where the added middle-row frame belongs relative to the earlier top/bottom sequence. Require all three five-by-five grids: only row1 lit, only row3 lit, only row5 lit; lit row99999 and all others00000. Insert the middle frame after the top frame/wait and before the bottom frame/wait. Flowchart Start, top output,500ms wait, middle output,500ms wait, bottom output,500ms wait,Stop. Exact matching complete source or identified attachment. No implicit endless loop or automatic clear; bottom image remains. Proper symbols and arrows, all25positions per frame. No numeric scores. Grown-up review; personal evidence is required.
Worksheet 7
- Question 11: Open and flash Sequence1Debug_Paxa.py, record its actual discrepancy and compare it with your plan. Correct all three faults, save a new revision and flash it again. Record expected versus actual frame positions, order, waits and final image, with a justified outcome for each check. Explain the corrections and retain retest evidence. Mark unavailable transfer or board observations Pending, separating source/simulator preparation from actual device testing. The original frame_2 lights row 4 rather than row 3; the output calls run 1, 3, 2; the middle output-call pause is 50 ms rather than 500 ms. Correct the frame_2 definition, order the calls 1, 2, 3 and use three 500 ms waits. Check top/middle/bottom positions, exactly five lights in each, every cell in all three frames, and the retained bottom image. Keep both source revisions and real expected/actual/retest evidence, or Pending. Source and simulator work are separate from USB and physical-device testing. Do not invent a successful retest. No numeric scores. Grown-up review; personal evidence is required.
Curriculum & workbook reference
- Cambridge Lower Secondary Computing 7 Student’s Book — pages 214–216
- PaxaKids Grade 7 Computing Lesson 6.9: Extending a light sequence — pages 1–7
Computing for your homeschool day
Explore Extending a light sequence 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.
