The Arizona STEM Acceleration Project
Loops and Logic
Loops and Logic
A 7th grade STEM lesson
Scott Blevins
Amanda Sibley
3/22/2024
Notes for teachers
Now students know what sensors are on their drone and how to read their outputs manually. Students also know how to program loops and conditional statements. This is a major key to programmed autonomous flight. Conditional statements and loops will allow a program to read for data from a sensor and “make decisions” based on conditional statements as to what the code should do next.
Developing Predictive Models: Click here
Error Sources and Sensor Integration: Click here
Sensor Integration: Click here
Loops and Logic: Click here
Sensor Integrated Movement: Click here
Sensor Integrated Movement- Taking Flight: Click here
List of Materials
Standards
Standards
Arizona Science Standards
Science and Engineering Practices:
Develop a model
Using mathematics and computational thinking
Arizona Mathematics Standards
7.RP.A Analyze proportional relationships and use them to solve mathematical problems and problems in real-world context.
Objectives:
Students will be able to use loops and conditional logic in the Blockly Senior programming environment to check the output of a sensor and make a decision based on those outputs.
Agenda (4 Days)
Day 1:
Students will learn about the value of a variable in programming. They will learn the logistics of creating a variable and will begin to see how a variable can be used in a loop to store a sensor input value.
Agenda (4 Days)
Day 2:
In this lesson students will learn about basic conditional statements. This will focus on if-else statements and their variants. The if portion will ask a yes/no question and the based on the yes/no response will direct to an else condition which may include specific direction of an operation to perform.
Agenda (4 Days)
Day 3:
Students will work through the activity link HERE to learn about loops. Students will see that a loop can be used to perform a task repeatedly or to perform a task until certain requirements are met.
Agenda (4 Days)
Day 4:
In this lesson students will learn how to develop a remote control code. Students will learn how to write a code that responds to keys pressed on the keyboard.
Intro/Driving Question/Opening
How can I develop a code that responds to input from a user or sensors on board the drone?
Hands-on Activity Instructions
Assessment
The work that students do when they complete the challenge task at the end of each lesson will demonstrate how much students are understanding of the material at hand.
Differentiation
Pair small groups based on ability- stronger peers with those who are struggling.
Check in with students consistently throughout the activity.
Remediation
Extension/Enrichment
Ask students who are getting the hang of it to create a cheat sheet. Take the best cheat sheet and give to groups in following lessons to serve as memory aids (remediation).