a1tD0000006jqWQIAY

Course: Introduction to Programming with NAO
4. Blinking Functions & Variables

  • 6-9 grade
  • Beginner

Lesson Description:

Lesson Description: 
In this lesson, students will control the color of the LEDs of NAO. They will familiarize themselves with the concept of variable and functions.

Objectives:

  • Identify variables and determine their values.
  • Define and call variables in the context of real-life activities.
  • Store a variable as a color value and pass it to a function to change LED's color
  • Be able to change the color of NAO's eyes.
  • Modify functions to accept parameters.
  • Describe how functions and parameters can make programs easier to write

image description

Lesson Modules


Teaching Tips:

You can download the code for this lessons here

In this lesson, the students will modify NAO's LED around the eyes using the proper Choregraphe boxes.

By doing that, they will get exposed to the concept of variable and functions. The variable is the color of the LEDs the function is the box the lights the LED of the robot.

 

Look at the NAO robot and pay attention. 

What did you notice while NAO was talking and playing music?



Teaching Tips:

In this module, the students will explore the boxes to modify the colors of the LEDs of the robot. The box has parameters that represent the duration for the LEDs to stay in a given color. The duration has to be long enough to give time to the robot to reach the color ( 3 seconds is a good time). 

The box has a color panel. The color panel and choice of color passed to the box that makes the LED change color is the variable. The box that makes the color changes is the function.

We are using LED colors to start the discussion and make it engaging.

(Optional) you can discuss the relationship between the colors of the eyes and emotions conveyed by the robot. 


Demonstrate New Content (10 minutes)

Show the students how to use the Eye LEDs box. If students want to learn about the other LEDs, tell them to read the reference sheet. Then have them read the Lights! student page.



Student Implementation (25 minutes)

Have students work on adding the lights to their story in Choregraphe. When they are done, they should move on to the Reflect and Revise! page. Walk around to check that students are on task and making progress with their stories.

If students finish early, have them work on the bonus lesson (lesson 10: Loops!).

Open you Choregraphe and look for boxes that control the LEDs of the robot.

For this module, we will focus on the LEDs to modify the color of the eyes.

Get familiar with how the box works. You won't be able to see its effect on the virtual robot, but you can understand how it works. 

How would you describe the elements of the eye LEDs box?



Teaching Tips:

Now the students will have a chance to create a program with a story and use the eye LEDs box to add "emotions" to the robot while he talks.

The LEDs can be seen only with a real robot, so they need in turn to load their program on the robot. 

They could all save their program on a USB key and in turn, load it on the computer that is connected to the robot. 

Or if each student connects to the robot with their own computers, don't forget to have them disconnect every time to let the others connect. 


Your Story! 

Today you will make Nao’s eyes change color as it tells a story. Think about which part will have the eyes color change and why!

At what part in your story are you going to make Nao's eyes change color?

What color are you going to use?

How long are you going to make that color last?

Where else do you want to add color?




Teaching Tips:



AFTER CLASS

Store Student Files
Put the student files on a thumb drive or store them in some way so that the students can continue working on their project in the next lesson. 

Pack Up Hardware
Pack the robots and computers according to the packing instructions.

What did you learn about LEDs?

how would you describe the color choice sent to the robot in programming concept?
  • The colors are a programming function.
  • The colors are a programming variable sent to a function.
  • The colors are just colors.