Ozobot Classroom

Lesson Creator

  • Preparation
  • Direct Instruction
  • Student Practice
  • Supplements
  • Review

1. Tell Us About Your Lesson

All fields are required unless marked as optional

A. Lesson Overview


Students will

B. Lesson Details

Lesson Duration (minutes)The time (minutes) to complete the whole lesson.

Grade LevelsSelect all that apply


Subjects/TopicsChoose the most relevant subject(s). Select up to 3.


    Coding Styles


    Product Lessons


    Tested With

    2. Preparation

    This helps the teacher prepare for the lesson before the class session

    A. Student Materials

    B. Background Knowledge (Optional)

    C. Lesson Tips (Optional)

    Add tips for the educator that don't fit into Direct Instruction or Student Practice. You can always return to this page to add more.

    This lesson is part 2 of a 3 part series. Make sure students have their cookie jar drawing and saved Ozobot Blockly program from the previous lesson. Share codes are included in the Direct Instruction for teachers to pause and check student work.

    This lesson works in both Ozobot Blockly (Evo only) or the Ozobot Editor (Evo and Ari). If you are using Evo with Blockly, create your program at https://ozoblockly.com/editor. The sample solutions can be accessed here:

    https://ozo.bot/b/7kgqvo, Share Code 7kgqvo

    https://ozo.bot/b/g4bqd8, Share Code g4bqd8

    If you are using Ari or Evo with the Ozobot Editor, create your program at https://editor.ozobot.com/blockly. The sample solutions can be accessed here:

    https://editor.ozobot.com/blockly?programId=ynbndfw, Share Code ynbndfw

    https://editor.ozobot.com/blockly?programId=eze397h, Share Code eze397h

    3. Direct Instruction (Teacher-Facing Instructions)

    These are the steps the educator will read. Include any front loading, modeling or explicit instruction before students work independently or in groups.

    Instruction

    Introduction

    This is the 2nd lesson in a 3 part series. In the previous lesson, students learned how to use a variable to count all the cookies in the cookie jar. In today’s lesson, we will learn how to code a conditional statement into your program to enable Ozobot to perform actions while counting.

    1. On a piece of notebook paper, have students write the sentence, “If the cookieCount equals , then Ozobot will .”
    2. Students will fill in both blanks with the total number of cookies in their cookie jar. This sentence is explaining what Ozobot will do when it has counted all of the cookies. For example, “If the cookieCount equals 10, then Ozobot will spin and play a happy sound.”
    3. Explain to students that they have just created a conditional statement. A conditional statement tells your Ozobot to execute an action depending on whether a condition is true or false.
    4. Next, have students write, “If the cookieCount equals _, then Ozobot will flash colored lights.” This will signal what Ozobot is going to do when it has counted half of the cookies. Students will fill in the blank space with half the total number of cookies in their jar.

    Instruction

    Time to Code

    We want Ozobot to flash colored lights once it has counted half of the cookies and celebrate once it has counted all of them!

    1. Help students to open their program from the previous lesson.
    2. Then ask students to code a celebration to celebrate counting all of the cookies.
    3. Many students might create a program by adding celebration blocks after the Count With loop block, such as this (https://ozo.bot/b/7kgqvo ). While this is one way to add a final celebration move, we also want Ozobot to flash colored lights when it has counted half of the cookies.
    4. Today we are going to introduce a conditional statement to enable Ozobot to execute an action depending on the condition. This means we can tell Ozobot what to do when it has counted half of the cookies and what to do when it has counted all of the cookies.

    Instruction

    If-do Block

    Let’s create a condition that enables Ozobot to flash colored lights when it has counted half of the cookies:

    1. Under level 4 in the Logic category, you will find the If-do block, which represents the simplest conditional statement. When the condition you specify as an input is met, the program executes the code you place in the If statement's body.
    2. Explain to students that this block is the same as the “if, then” sentences they wrote at the beginning of the lesson. We are swapping the words then with do.
    3. Place the If-do block after the Wait 1 Second block.

    We want to specify that Ozobot will flash colored lights when it has counted half of the blocks. To do this, we need to use the Compare block in the logic category and add it to the If statement’s body.

    1. Next, copy and paste the Variable block titled “cookieCount” from the program. Add it to the first space in the Compare block.
    2. In the second space of the Compare block, add a Number block and add the value of half of your cookies.
    3. You have created a condition, “If the cookieCount is half the total number of cookies…”

    Now that we have set the condition, we need to tell Ozobot what to do if it is met.

    1. In the do statement’s body, add the Set Light Color block from level 3 and choose any colors to turn on Ozobot’s front lights.
    2. Then add a Wait 3 Seconds block and a Turn Front Lights Off block. These will enable the lights to stay on for 3 seconds then turn off.
    3. Ask students to look over the conditional statement they’ve created and read it as a full sentence. An example of your conditional statement should read, “If the cookie count equals 5, then Ozobot will flash green and yellow lights.”
    4. Run your program. Ozobot should count all the cookies in the cookie jar and flash colored lights when it has counted half of the cookies.

    Instruction

    Else-if do Block

    Now let’s create a condition that enables Ozobot to celebrate when it has counted all of the cookies:

    1. The If-do block is reconfigurable, which provides possibilities for more complex logic. You can control the program flow depending on specific outcome scenarios for the condition you are evaluating. This means we can add another condition to our statement.
    2. If you press on the small gear button inside of the If-do block's upper left corner, a popup will show up. Drag the Else If block over to the white side of the pop up.
    3. Copy and paste the Compare block you have created above and add it to the if statement’s body. You will need to change the value to your total number of cookies. Ozobot Blockly Share code: https://ozo.bot/b/7jkree
    4. Now you have created a condition for Ozobot to execute an action when it has counted all of the cookies. Add any celebration blocks to the do statement’s body.
    5. Run your program. Ozobot should count all the cookies in the cookie jar, flash colored lights when it has counted half of the cookies, and celebrate when it has counted all of the cookies. Ozobot Blockly Share code: https://ozo.bot/b/g4bqd8

    Instruction

    Save Program

    Before wrapping up, show students how to save their programs in Ozobot Blockly or by copying down their unique share code.

    4. Student Practice (Student-Facing Instructions)

    These are step-by-step instructions delivered directly to the students as they work independently or in groups

    Student Instructions

    Instruction

    See Direct Instruction

    Please upload any student resources, videos, etc. (Max. size: 512 MB videos, 10 MB all other files)

    Goal

    Lesson Extension (Optional)

    Add student instructions for a lesson extension.

    Instruction

    Encourage students to experiment with different values for the Compare block to make a condition when a certain number of cookies has been counted. For example, you can have Ozobot perform an action when it has counted all the cookies besides 1.

    Please upload any student resources, videos, etc. (Max. size: 512 MB videos, 10 MB all other files)

    Goal

    5. Supplements

    A. Lesson Closure (Optional)
    Give tips for how to wrap up the lesson and assess student learning. (Want to add an attachment? Use Part C, below.)

    Pair students up to explain their conditional statements to one another. They will do this by reading their blocks as if it were a complete sentence, for example “If the cookieCount equals 5, then Ozobot will flash colored lights. If the cookieCount equals 10, then Ozobot will spin and play a happy sound.”

    B. Academic Standards (At least one standard required)
    Choose a category from the dropdown on the left. In the blank on the right, begin typing the number of the standard.

      csta-1b-ap-09 csta-1b-ap-10 iste-5-d

      C. Add Other Attachments (Optional)
      Please upload any student handouts, videos, sample solutions, etc. (Max. size: 1 GB videos, 10 MB all other files)

      Add Cover Image

      Review

      Please review your lesson before submitting.

      Save Draft

      Please login or create an account to access this content and more!

      Login / Create account