0% found this document useful (0 votes)
38 views5 pages

L1 Lesson Plan Microbit Countdown

Uploaded by

22pereirag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views5 pages

L1 Lesson Plan Microbit Countdown

Uploaded by

22pereirag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Transition- Year 7 – Programming with the micro:bit Lesson plan

Lesson 1

Lesson 1: micro:bit countdown


Introduction
Learners will recap micro:bit input blocks from the KS2 transition lessons and be
introduced to a count-controlled loop and efficiency in program code. Students
will explore the use of a FOR loop using the terminology iteration to create a
sports countdown starter.

Learning objectives
 Compare different inputs on the micro:bit
 Define iteration
 Modify a program with count-controlled iteration
 Create a countdown program using count-controlled iteration

Key vocabulary
Iteration, efficiency, count-controlled iteration, loop

Preparation
Subject knowledge:

An understanding of the makecode programming environment will aid the lesson


and completion of the KS2 transition lessons will allow progression from concepts
covered. Students will be able to access the learning without the previous
lessons but an advantage will be had by any that have undertaken the previous
activities and lessons.

Prior knowledge for accessing this lesson is an understanding of variables and


how they are used as well as an understanding of how to use the repeat 10 times
block in program code on the miro:bit.

Pedagogy:

Pair programming. We strongly recommend that you decide on your pairings


before the lesson for a smooth transition into the activity.

PRIMM – The lesson has a structure to allow understanding to be developed


throughout the lesson to enable all to access the activities.

Page 1 Last updated: 13/06/2024


Transition- Year 7 – Programming with the micro:bit Lesson plan
Lesson 1 – micro:bit countdown

You will need:


● Access to makecode (https://makecode.microbit.org/ ) via a web browser
● 1 x micro:bit, battery pack and USB cable per pair
● Starter worksheet
● Starter worksheet solution
● Activity worksheet

Assessment opportunities
Through activity 1 students will be able to demonstrate learning and
understanding through the comments added to the program code.

The worksheet allows activity notes to be made and observing learners in their
pairs will aid assessment of understanding.

Please note that the slide deck labels the activities in the top right-hand corner
to help you navigate the lesson.

*Timings are rough guides


Starter Slide 2 - What are the different micro:bit inputs
activity (think/pair/share)
(Slide 2-3)
Ask learners to think, pair, share. The image on the slide is of
5 mins version 2. If learners are using version 1, they only need at this point
to recall the different inputs they remember. The starter worksheet
can aid note taking.

Version 1 inputs include: buttons, light sensor, temperature sensor,


accelerometer, compass.
Version 2 inputs include: all version 1 inputs and additionally a
touch sensor and microphone - sound sensor.

Slide 3 – Input recap

Ask learners to complete the starter activity on the worksheet.


Discuss as a class the different inputs – logo and sound are linked to
version 2.

Activity 1 What will this program do?


(Slides 5– Learners to use the simulator for slides 5 and 6.
8)
Slide 5 - Ask learners to look at the code displayed and predict what
15 mins will happen when the program code is run. Ask for a volunteer to
share their prediction and ask the class if any have a different
prediction.

Run the code on https://makecode.microbit.org/_J9b0xbMH84XF this


is the code shown on the slide and when you click it, you will need to
click edit to go into makecode to view the code and simulator in the
environment.

Page 2 Last updated: 13/06/2024


Transition- Year 7 – Programming with the micro:bit Lesson plan
Lesson 1 – micro:bit countdown

Slide 6 - Ask learners to open


https://makecode.microbit.org/_1xzUVJKWYFqu also shared on the
activity worksheet. They will need to follow the same instructions as
previous to access the makecode environment – click edit.

Demonstrate how to move the comments to the side so that they are
near the block they are linked to. The sharing of code always places
the comments on top of the code.

Learners will need to fill in the blanks on each comment to


investigate the program further.

Discuss the importance of using a set variable block in the on


start block. The program must have a starting value for the variable
for the use of it within the loop. The variable has been called index,
explain to learners that the in programming the word index is used
to determine a value or position so is a name that makes sense in
this example.

The program will start when the A Button is pressed. The loop is
activated now and the number is displayed each time the loop
repeats the instructions inside it. The change variable block
defines how the variable is adjusted each time, in this instance it is
increased by 1.

Slide 7 – Ask learners to modify the program they have to


countdown from 9 editing the variable by -1 each time the loop runs.
Stretch learners by asking them to add comments to the new
sections or edit the comments to match the new code
amendments.

Slide 8 – Ask learners to connect their micro:bit and test the


program code. Optional dependent on number of micro:bits

Activity 2 Introducing count controlled iteration


(Slides 9–
13) Slide 9 -Introduce the key terms:
● Iteration
15 mins ● Count-controlled iteration

Learners in KS2 will have used the terminology repetition, this slide
introduces the terminology iteration and that this is the same and
will be the keyword used moving forward.

Slide 10 – Explain to learners that the previous program to


countdown used a lot of blocks of program code. In programming,
the aim is to write the program in less lines of code.

Page 3 Last updated: 13/06/2024


Transition- Year 7 – Programming with the micro:bit Lesson plan
Lesson 1 – micro:bit countdown

Introduce the key term


 Efficiency
 Efficient

Learners can use a for loop, which is the same as the repeat 10
times loop they have previously used. However, this type does not
need to have a variable set as it is built into the loop. Explain that
this also matches closer to programming with written lines of code, a
for loop would always be used as a repeat loop is not a line of code
that could be used in, for example Python.

Explain that the starting iteration is 0 and then it increases by 1 each


time to loop iterates over the instructions inside the block.

Ask learners to change their program code to match the new


efficient code with a for loop.

Slide 11 – Show the video and ask learners what they notice about
this sport starter.

Slide 12 - This is the starter for the cycling at the velodrome. There
is a sound linked to the start time reducing so that the sport person
can hear the countdown and does not need to watch it.

Slide 13 – The for loop example showed the increase of time from 0
to 9. A countdown needs to reduce by 1 from 9 to 0. Explain that we
need to use a math block to make sure the calculation starts at 9.
The addition on the block means that the first iteration will calculate
9-0, the next iteration would be 9-1 and so on until it reaches 9-9.

Ask learners to amend their program to reduce by 1 using the math


block.

Activity 3 Creating a countdown


(Slide 14–
15) Slide 14 – Introduce or recap the way pair programming works for
the activities. Encourage learners to decide the roles and swap at
15 mins regular intervals.

Slide 15 – Learners can use the parson problem starting point


https://makecode.microbit.org/_KwaA5wTWP5DA with the blocks on
the canvas to use. To stretch learners they can continue with the
program code they have and consider how they would add in the
code for a sound effect and the use of GO after the loop has
completed the iterations.

Encourage learners to explore the different effects and notes to find


one that fits a sports starter.

Remind learners they are developing a functional sports starter that


can be tested.

Page 4 Last updated: 13/06/2024


Transition- Year 7 – Programming with the micro:bit Lesson plan
Lesson 1 – micro:bit countdown

Learners will need to download the code, connect the battery and
test the starter to see if it works as expected.

Activity 5 Plenary
(Slide 16)
Slide 16 - This task is designed to reinforce the key concepts from
5 mins this lesson looking at code being efficient. Ask learners to think, pair,
share their answer to the code to determine if they can articulate
their understanding of why the code on the right is efficient.

Next time Review the summary slide.


(Slide 17)

2 mins

Homewor There is no homework set for this lesson.


k

Resources are updated regularly — the latest version is available at: ncce.io/tcc.

Attribution statement
This resource was created by STEM Learning for the National Centre for Computing Education.
The contents of this resource are available for use under the Open Government License (OGL v3)
meaning you can copy, adapt, distribute and publish the information. You must acknowledge the
source of the Information in your product or application, by attributing Raspberry Pi Foundation and
STEM Learning as stated here and are asked to provide a link to the OGL v3.
If the resource has been updated the original version can be made available on request via
[email protected].

Page 5 Last updated: 13/06/2024

You might also like