a1tD000000885egIAA

Course: Engineering Design with LittleBits Code Kit
2) Loops

  • 6-12 grade
  • Beginner

Lesson Description:

Students learn about loops and then apply it to their code to…

  1. Create a program that has the LED Matrix show a series of images to create an animation.
  2. Create a program that reveals different displays when the input is on versus when the input is off.
  3. Create your own goal using the loop blocks and program the LED Matrix to reach that goal.

image description

Lesson Modules


Teaching Tips:

This lesson will take about 2 hours to complete. You may have to split the lesson into multiple classes.

Many of the activities in these lessons exist in the tutorial section of the LittleBits Code Kit App. These tutorials show the students EXACTLY how to set up their code. If students do this then they are not problem solving and learning how to program. Try to reduce the risk of students using the tutorial page to build their program.  You can tell if the students are using the tutorials or not by looking at the top left of their screen. If it says “Blank Canvas” they are most likely doing it themselves. If it says anything else, it is likely they are using the tutorial.

If this is what is shown on the top left of the students' screen then they are making their own project.If there is any other name in the upper left hand of the students' screens then they are using a tutorial and are likely not creating their own project.


Materials:

  • One LittleBits Code kit per group (suggestion: 2-3 students per group)
  • One computer for each student group
  • Teacher computer
  • Internet connection
  • Projector

Preparation: none

Observation activity:

Have a student volunteer pretend to be a robot. You (the teacher) will be the programmer. You will have the student stand on one side of the classroom with you at the other. You will repeatedly repeat the command “take one step forward” until the student gets to you.

Ask the students: Do you think this is how programmers program?

Then ask students to brainstorm what a better command would be to achieve the same result? (possible responses: count how many steps it would take and program the robot to take that many steps, program it to step forward until it runs out of space.)

In this section we will begin to explore the concept and purpose of loops. 


Teaching Tips:

1)      Present the goals to the students

2)      Show the students the video about loops

3)      Ask the students to explain what a loop is. (a loop is a sequence of instructions that is continually repeated until a certain condition is reached.)

4)      Show the students the 4 loops on the class view. Facilitate a discussion about their predictions on what each loop block does.

5)      Then show them the descriptions of each code on the class view. Have the students think of as many examples as they can of when/why a programmer would use each type of loop block. (ex: the do forever block would be useful if a programmer wanted a song to continually play)

6)      Show the students the “Code Kit Tutorial 2: Loops” video on the class view

7)      Set up your Little Bits like this.  

9)      Open the LittleBits Code Kit App.

10)   Set up this code

11)   Ask the students to predict the outcome of the code.

12)   Then play upload the code. Facilitate a conversation about how the code worked.

13) Set up this code

14) Ask the students to predict the outcome of the code.

15) Then play upload the code. Facilitate a conversation about how the code worked.

16) Set up this code

17) Ask the students to predict the outcome of the code.

18) Then play upload the code. Facilitate a conversation about how the code worked.

19) In order for students to understand the next loop, they need to understand conditions. Play the conditional video on the class view.

20) Ask the students to explain conditionals.

21) Ask the students how they experience conditionals in real life. Ex: if it is a schoolday, wake up at 7AM, else wake up at 9 AM

22) Set up this code

23) Ask the students to predict the outcome of the code.

24) Then play upload the code. Facilitate a conversation about how the code worked.

25) Set up this code

26) Ask the students to predict the outcome of the code.

Then play upload the code. Facilitate a conversation about how the code worked. 

In this section we will look at slighty different codes and discuss how the outputs will differ. 


Teaching Tips:

1st goal:

Show the students’ first goal on the class view.

Create a program that has the LED Matrix show a series of images to create an animation.

During the design time, walk around and prompt your students with questions to help deepen their learning and thinking process. Some examples of questions are:

  • Why did you make that design decision?
  • What do you predict your code will do?

Here is an example of a working code for this goal:




2nd goal

Show the students’ second goal on the class view.

Create a program that reveals different displays when input is on versus when the input is off.

During the design time, walk around and prompt your students with questions to help deepen their learning and thinking process. Some examples of questions are:

  • Why did you make that design decision?
  • What do you predict your code will do?

Here is an example of a working code for this goal:



3rd goal

Present the challenge goal on the class view.

Create your own goal using the loop blocks and program the LED Matrix to reach that goal.

Have students submit their goals as a response to a question on the student view.

Once the students have submitted their goals, facilitate a conversation about their responses.

During the design time, walk around and prompt your students with questions to help deepen their learning and thinking process. Some examples of questions are:

  • Why did you make that design decision?
  • What do you predict your code will do?

In this section we will build 3 different programs using loops. 



LittleBits Blockly Key



Little Bits Code Kit Reference


Create your own goal using the loop blocks and program the LED Matrix to reach that goal.





Teaching Tips:

Have students answer the following questions on their computers. Once all the students have finished answering the questions have a class discussion about their answers. 

  1. Explain loops.
  2. What was the most challenging part of using loops? What strategies did you use to overcome this challenge?
  3. What is the coolest thing about coding with loops? Explain why.

In this section we will reflect on our understanding of loops.


Explain loops.

What was the most challenging part of using loops? What strategies did you use to overcome this challenge?

What is the coolest thing about coding with loops? Explain why.