7 - Microbits 3 - loops

7 - Microbits 3 - Iteration

1 / 10
volgende
Slide 1: Tekstslide
ComputingLower Secondary (Key Stage 3)

In deze les zitten 10 slides, met interactieve quizzen, tekstslides en 1 video.

time-iconLesduur is: 50 min

Onderdelen in deze les

7 - Microbits 3 - Iteration

Slide 1 - Tekstslide

Key Objectives
All: Know what is meant by Iteration and how to create a loop.

Most: Recognize the usefulness of loops in programming, understand how accessories can be wired to the Microbit.

Some: Understand how to use loops to create a song with Microbit and play a song from the Microbit.

Slide 2 - Tekstslide

Slide 3 - Link

Recall challenge: Musical instrument
The LEDs on a Microbit can also sense light on a scale of 0-255
We can use this to change the pitch of a musical note.

Make the test Microbit play different notes depending on the light it receives.
Include: 
A variable
An if statement

Slide 4 - Tekstslide

Solution
You just made a super basic version of a theremin

Slide 5 - Tekstslide

Slide 6 - Video



Roll your foil up into two makeshift wires.
 wrap them around the top and bottom metal parts of the headphone jack and connect them to 0 and GND as shown above.

Slide 7 - Tekstslide

Write a smash hit!
Use blocks like these to write
 a short tune in sequence.
Write a song with iteration
Music contains loops and patterns. 
The best recording of a riff will often be digitally repeated, rather than played imperfectly over and over
1: Write a short riff in sequence.
2: Place your riff inside a for loop.
3: Manipulate the Index variable to make the riff play twice.
4: Write a second riff in sequence
5. Place that riff in a while loop which repeats twice.
 
Final task: Write a full length song with verses and a chorus.

Slide 8 - Tekstslide

What is iteration?
A
A method of structuring data
B
The process of repeating a set of instructions or operations until a specific condition is met
C
The act of combining two or more datasets into one
D
The process of debugging a program to eliminate errors

Slide 9 - Quizvraag

What did you find most challenging in today's lesson?

Slide 10 - Open vraag