a1tD0000003mDyvIAE

Course: Scratch with Autonomous Car
7: Combining Two Programs

  • 1-5 grade
  • Beginner

Lesson Description:

In this lesson, students will learn basic concepts in Computer Science: 
    1    Combining programs
    2    Debugging
To illustrate these concepts we will combine two previous programs to create something with a new functionality!

Objective:
Apply programming concepts to combine two programs into one for increased functionality.


 

Standards Covered

3-5-ETS1-1

Define a simple design problem reflecting a need or a want that includes specified criteria for success and constraints on materials, time, or cost.

3-5-ETS1-2

Generate and compare multiple possible solutions to a problem based on how well each is likely to meet the criteria and constraints of the problem.

3-5-ETS1-3

Plan and carry out fair tests in which variables are controlled and failure points are considered to identify aspects of a model or prototype that can be improved.

CCSS.MATH.PRACTICE.MP1

Make sense of problems and persevere in solving them.

CCSS.MATH.PRACTICE.MP2

Reason abstractly and quantitatively.

CCSS.MATH.PRACTICE.MP3

Construct viable arguments and critique the reasoning of others.

CCSS.MATH.PRACTICE.MP4

Model with mathematics.

CCSS.MATH.PRACTICE.MP5

Use appropriate tools strategically.

CCSS.MATH.PRACTICE.MP6

Attend to precision.

CCSS.MATH.PRACTICE.MP7

Look for and make use of structure.

CCSS.MATH.PRACTICE.MP8

Look for and express regularity in repeated reasoning.

image description

Lesson Modules


Teaching Tips:

Contrary to popular belief, deer do not freeze in front of your headlights because they are scared.  They freeze because they are nocturnal, and their eyes are adjusted to see in the dark.  When we flash bright lights on them, we blind them for a moment!  Rather than run somewhere blind, they wait for their eyes to adjust to the new surroundings.  As soon as they realize they're standing next to a car they run away.

The phrase "he froze up like a deer in the headlights!" has been around as long as cars, but did you know that it first became popular when it was used on TV during the 1988 presidential election?  It means "to freeze in shock and surprise when something happens that you didn’t expect" like a deer when it crosses the road at night and sees a car.

So, how should a self driving car deal with an obstacle like an animal?  And how can you combine two different programs into one?  In this lesson we'll find out!


Why do you think a deer freezes up in the headlights?
  • Because it is scared
  • Because it is blinded by the light
  • Because it is interested in the car
  • Because it is tired of walking


Teaching Tips:

Question 1:  (Facilitate a class discussion for this question)
Try to make a list of everything you should do. 
(Something like)

  1. Stop the car
  2. Turn off the lights
  3. Let the deer move away
  4. Turn the lights back on
  5. Start the car again


Question 2: Lessons 2 and 5

​Only show class view after the discussion is over

Now that you know why deer freeze up in headlights, what do you think you should do when you come upon a deer in the road?






Are there any programs we have written before that did any of these things?
  • Lesson 1
  • Lesson 2
  • Lesson 3
  • Lesson 4
  • Lesson 5
  • Lesson 6




Think back to the lessons you've completed before:

SCRATCH 1: Introduction

SCRATCH 2: Distance Detection

SCRATCH 3: Predicting the Future
(You didn't write code for this lesson)

SCRATCH 4: Energy

SCRATCH 5: Light Detection

SCRATCH 6: Heat Detection


Pick two lessons that you think you can combine to solve the problem.


Teaching Tips:

Here is the code: Lesson 7 Code

Here is a Step-by-Step guide to complete the code: Scratch Lesson 7 Instructions


The correct answer is provided here for teachers:


SCRATCH 2: Distance Detection

SCRATCH 5: Light Detection



Teaching Tips:

Question 1: Check the concepts you understand.  Don’t worry, this isn’t for a grade, it’s just so your teacher can check the classes’ understanding.
This is the students' self-assessment of their understanding of the material.  You will see a bar graph once all the poll answers are submitted.


Question 2: Can you use two sensors at once?
Yes!  



Check the concepts you understand. Don’t worry, this isn’t for a grade, it’s just so your teacher can check the classes’ understanding.

an you use two sensors at once?