Codey Rocky: Sequences D1 Wink, Wink
In this lesson, students will learn to code a sequence changing the facial expressions of Codey Rocky using the built in images.

Lesson
Overview
Description
In this lesson, students will learn to code a sequence changing the facial expressions of Codey Rocky using the built in images.
Objectives
students will be able to describe what a sequence is
students will be able to program a sequence using Codey Rocky
Before the Lesson
Preparation
Review our introductory video to get accustomed to Codey Rocky's different features: https://www.youtube.com/watch?v=q7t-H7s7yYM&t=13s
Fully charge the tablets and robots.
Install mBlock 5 on a compatible Windows or Apple device: https://www.mblock.cc/en/download/
Review
Sequences
Introduce the concept of sequencing as a list of steps performed in order to finish a task. This can be introduced by relating the concept to real life. Use the following scenario or feel free to create your own:
"We need to put the Watermelon we just bought in the refrigerator. In order to do this we need to do a sequence of events: Step 1) Open the refrigerator door. Step 2) Put the watermelon in the refrigerator. Step 3) Close the refrigerator door. If you follow the wrong sequence, you wouldn’t be able to put the watermelon in the refrigerator."
Have students brainstorm their own "real life sequences" that require a few steps. Good examples of this are: getting ready for school, cooking a meal, performing in an athletic event. Have them also discuss what would happen if any item in the sequence was in the wrong spot.
Direct Instruction
Introduction to Codey Rocky
Say, “Today, we’ll be programming a robot called Codey Rocky. First, let’s see what we notice about Codey Rocky.” Turn on Codey Rocky in front of the class. Encourage students to share what they notice about Codey Rocky.
Sample response: “Codey Rocky comes in two parts! Codey Rocky can move! Codey Rocky has a face!”
Say, “Codey Rocky is made of many different parts. These parts allow Codey Rocky to move around, be controlled remotely, and make different faces and sounds.”
Connecting to mBlock 5
Project your computer screen and open the mBlock 5 program. Point out the icon and how it can be found in your specific system or device. Discuss the wireless dongle and how it is used to connect a specific Codey Rocky to a computer. The dongle is required for the Codey Rocky to be connected to the computer, so keeping that dongle safe and with the proper Codey Rocky is very important.
(Optional) Work with the class to label their dongle and device if they are not labelled already. These can be permanent device identifiers using a label maker (i.e Codey Rocky 1) or have the class temporarily name their Codey Rocky and label it with a sticky note or piece of paper and tape. (even if a device has a permanent label, it is always fun to allow students to name their devices)
Model connecting Codey Rocky to mBlock 5 by performing the following steps:
Turn on Codey Rocky
Open mBlock 5 if it is not open already
In the area where it says "Connect your Device" click the BLUE connect button.

Plug in the USB dongle.
Select the USB dongle from the drop down. It will be listed as "/dev/tty.wchusbserial14xx" with the last two number being different depending on the port the USB is plugged in to (ex. 1410, 1420)

You will know the device is connected when the window in mBlock 5 changes, indicating a proper connection and your ability to now upload code to Codey Rocky.

(Optional) Have students connect and disconnect their Codey Rocky from mBlock 5 a number of times to practice the process so they can do it independently going forward when instructed.
Guided Practice
First Sequence
Say, "We spoke earlier about the Codey Rocky and how it actually comes in two parts. In this lesson, we are going to learn how to program Codey Rocky's face to wink at us!"
Say, “We are going to use what is called a sequence to control when Codey Rocky winks.”
Modelling Sequence
Demonstrate on your screen how to create a Sequence using the example code below.

Upload this code to your Codey Rocky and run it for your students to see.
Say "By using this code you can see that we've been able to make Codey Rocky wink for us!"
Independent Practice
Wink, Wink!
Leave the code you used to demonstrate the wink on screen.
Say "Now it is your turn to make Codey Rocky wink. Replicate the code on my screen, upload it to Codey Rocky and get yours to wink too!"
Move around the class observing and assisting as needed. Issues student may have include:
Remembering which section to pull the blocks from
Remembering how to upload the program to Codey Rocky
Wrap Up
Follow-Up Questions/Discussion
Say "What else do you think we could do with Codey Rocky's screen"
Some answers may be:
Make other faces.
Draw shapes.
Say "In the next lesson we are going to do just that! We will use more sequences to do other things with Codey Rocky's screen"
Educational Standards
ISTE
ISTE
4d: Exhibit a tolerance for ambiguity, perseverance, and the capacity to work with open-ended problems.
5a: Formulate problem definitions suited for technology-assisted methods such as data analysis, abstract models and algorithmic thinking in exploring and finding solutions.
6b: Create original works or responsibly repurpose or remix digital resources into new creations.
7c: Contribute constructively to project teams, assuming various roles and responsibilities to work effectively toward a common goal.
CSTA
CSTA
1B-AP-10: Create programs that include sequences, events, loops, and conditionals..
1B-AP-11: Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.
1A-AP-12: Develop plans that describe a program’s sequence of events, goals, and expected outcomes..
1B-AP-15: Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended..
1A-AP-15: Using correct terminology, describe steps taken and choices made during the iterative process of program development.
Alberta - Grade 4 - ICT
Grade 4
ICT
C5: Students will use technology to aid collaboration during inquiry.
C6: Students will use technology to investigate and/or solve problems.
F6: Students will demonstrate a basic understanding of the operating skills required in a variety of technologies.
Ontario - Grade 4 - Mathematics
Grade 4
Mathematics
Algebra (Coding)
C3.1 solve problems and create computational representations of mathematical situations by writing and executing code, including code that involves sequential, concurrent, repeating, and nested events
Nova Scotia - Grade 4 - ICT
Grade 4
ICT
P2: Students will be expected to use digital tools to develop ideas and original works in innovative ways.
TOC1: Students will be expected to
safely use many forms of current technology for learning with growing competence
demonstrate conceptual understanding of how information and communication technology, digital tools, and authorized networks support their learning
use terminology related to information and communication technology
British Columbia - Grade 4 - ADST
Grade 4
ADST
• Make changes and test again, repeating until satisfied with the product
• Use materials, tools, and technologies in a safe manner, and with an awareness of the safety of others, in both physical and digital environments
• Identify the skills required for a task and develop those skills as needed
• Use familiar tools and technologies to extend their capabilities when completing a task
• Demonstrate a willingness to learn new technologies as needed
