Use Marty's noise sensors to trigger a response when a change occurs

Challenge learners to have actions approximate the level of noise in the classroom:
Challenge learners to use an additional variable(s), that way a different action can occur whether the current level of classroom noise is louder or quiter than it was on the last pass of the function.
Consider including parallel code for example, sounds or actions from add-ons, depending on values from the variable that stores the noise sensor values.
Have physical code cards available for learners to use, when building their scripts:
Have a print out of the basic function statements, using the noise sensor.
Encourage pseudo code to clearly outline what you want to happen based on certain results.
Reminders for where a noise sensor might be used:
25 of 25 linked standards shown.
| Curriculum area | Linked standards |
|---|---|
| Digital Technologies, Design & technologies: Design & Technologies | |
| Digital Technologies, Design & technologies: Digital Technologies |
Select a code to read the full standard.
| Curriculum area | Linked standards |
|---|---|
| General standards |
Select a code to read the full standard.
| Curriculum area | Linked standards |
|---|---|
| Health and Wellbeing: Mental, Emotional, Social and Physical Wellbeing | |
| Literacy & English: Listening and Talking | |
| Literacy & English: Reading | |
| Literacy & English: Writing | |
| Technologies: Computing Science | |
| Technologies: Craft, Design, Engineering and Graphics |
Select a code to read the full standard.
| Curriculum area | Linked standards |
|---|---|
| Computing, Design and Technology: Computing | |
| Computing, Design and Technology: Design and Technology |
Select a code to read the full standard.
| Curriculum area | Linked standards |
|---|---|
| International Society for Technology in Education (ISTE) |
Select a code to read the full standard.
| Curriculum area | Linked standards |
|---|---|
| Middle School Technology Applications: Grade 6 to Grade 8 |
Select a code to read the full standard.
In this lesson learners extend their use of noise sensors and their awareness of functions and variables. The program will use a variable and will move Marty in different ways, depending on the stored value. The opportunity to use nested conditional statements and loops also exists.
Please read the knowledge base article about the noise sensor addon, before engaging with this lesson.
Experience using sensors, functions and variables
Begin by revising the purpose of function blocks. Have learners recall ideas from the recent lesson on the light sensor that featured function blocks. Ideas may include that function block tend to have only one purpose, different parts of a program can call the same function block, functions can call other functions. Inform learners that today they are going to be using sensors again, this time, a different level of noise is going to result in a different action.
Have learners think of events in their lives where actions change depending on the level of noise in an environment: your neighbours may react differently, or may not react, depending on the level of noise; a teacher may respond differently depending on the noise in the classroom; a sportsperson or team might respond differently depending on the level of noise coming from the crowd, think of golf, snooker or football.
Share the objectives and success criteria from the presentation.
Have learners think of a person's response to noise based upon the situation. When is it good to be noisy, when it is good to be quiet? How do we react differently to different noise levels?
Have Marty carry out the code in the video from the presentation, which involves multiple function blocks with different actions occurring, depending on the level of noise. The code is described in the teacher guide.
Inform learners that the code that causes Marty to run relies on a variable. Ask which values might be stored as a variable, in this instance. Examples could include, the level of noise, the limits for the movement to occur. Ask if the learners noticed that the movements changed as the program ran, could they identify a change that occured in the program to trigger a different movement? Answers might include that the noise level changed. (The levels on the noise indicator in the video are not perfectly aligned to the sound, due to video editing that occurred.)
Remind learners of the noise sensor block so they can find a good range to use for measuring levels in the classroom. By clicking the tick box beside the noise sensor block, in the sensing section, learners can see a live display of the noise in the classroom. The values learners see can give them an idea of what quiet and noisy sounds like, they should record this to be the range of what Marty should use to react to the noise.
Show the second video, of a basic movement with Marty responding to a noise. Also highlight that the action happens once and then stops. How can we address this? Loops, maybe, but where would the loop go?
Give learners the time to work within their groups to plan what blocks they would use to allow for different movements based upon the noise sensed. Draw attention to the fact that unless you can somehow change the noise sensor value, Marty will only ever carry out one action. That would be boring for both you and Marty. The noise sensor will need to be used regularly, but it will also need to be stored so that it can be accessed at different times, in the program.
Learners need to plan for how to recognise a change in the level of noise and incorporate function blocks to make sure a range of different sound levels are considered.
Encourage regularly testing their code once they finish planning their work. Without periodically checking that the code is doing what is intended, work and time can be wasted because of the need to debug large blocks of code. This is another reason why having function blocks is a good idea: you can more easily spot where the bug is, if it occurs within a small function, when compared with a much larger block of code.
Bring learners back together to discuss the challenges they faced and overcame. Have groups model their creations and explain what is happening, when. Encourage other groups to ask questions to deepen the understanding of the processes.
Take time to have group code displayed to the class, encourage observational questions from peers.
Suggested questions you might ask:
Carry out any end of lesson routines.
Log off devices and clear everything away.