a1tD00000088DidIAE

Course: Engineering Design with LittleBits Code Kit
5) Function

  • 6-12 grade
  • Beginner

Lesson Description:

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

  1. Create a program that has the LED Matrix display multiple sequences of images using the function blocks.  Ex: a dance
  2. Create your own goal using function 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

·         Scissors

·         One print out of the handshake function handout per group:

·         Tape (one small piece per group to tape a piece of paper onto a blank space on the wall/board/window)

 

Preparation:

For the observation activity you will need a large blank wall/board/window space available. In the end it will look like this:

 

Observation activity:

1)      Show the students the video on the class view “The Best Handshakes Ever”

2)      Show the next section on the class view which instructs the students to create their own handshake with their group and write the directions for the handshake.

3)      Once the students have finished, have them show their team handshakes to the class.

In this section we will begin building functions through making a unique handshake.


Teaching Tips:

1)      Show the students’ goals on the class view.

2)      Let them know that today we are going to begin learning about function blocks.

3)      Show the next part on the class view where it has the images of the function blocks and descriptions. Have students guess how function blocks would be used within a program.

4)      Show the students the “Code Kit Tutorial 5: Functions” video on the class view.

5)      Facilitate a conversation with your students, how do function blocks work?

6)      Have students go back to their handshake handout. Have them do part 2: name the function (the name should go on the bottom and top function)

7)      Have students cut the 2 function blocks out separately.

8)      Have students tape their 2 function blocks up on the space you cleared out. (the title function under the start, the step by step directions function outside of the main thread)

9)      Once all of the groups have put their functions up. They will imitate how it would work. You will call out the names of the functions in sequential order starting directly under the start. Once you call a function, that group should perform the function.

Ex:

Teacher: “start”

Teacher: “Exploding Octopus Robot Handshake”

Student group performed their handshake “Exploding Octopus Robot Handshake”

Teacher: “coolest handshake ever”

Student group performed their handshake “coolest handshake ever”

Continue until all the function blocks in the main thread have been performed.

10)   Show the example code on the class view. Facilitate a conversation about what the code does. Answer: Instead of repeating this long code over and over again. The programmer made it a function, so in their code they just need to include 1 function block titled “1” for the song to play.




Teaching Tips:

GOAL 1

Show the students’ first goal on the class view.

Create a program that has the LED Matrix display multiple sequence of images using the function blocks.  Ex: a dance

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. The example below only shows the full split function.






CHALLENGE GOAL 2

Present the challenge goal on the class view.

Create your own goal using function 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.

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 create programs that use function blocks.



LittleBits Blockly Key



Little Bits Code Kit Reference




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


What is your 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 how function blocks work.
  2. What was the most challenging part of using function blocks? What strategies did you use to overcome this challenge?
  3. What is the coolest thing about coding with function blocks? Explain why.

In this section we will reflect on our learning about functions. 


Explain how function blocks work.

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

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