Illustration of Dot holding orange ball with dashed line to clock and arrow to a red net

Wait for

{{ tags[0] }} Blockly Coding Experience Conditions

Description

Conditions can affect what the robot does, such as pause programming until that condition is met. In this activity, Dash and Dot will stop and wait for a specific event to happen before they can finish the program. Learners are introduced to conditional blocks that help Dash and Dot make decisions. Learners will explore the ‘Wait for’ and ‘Wait for “x” seconds blocks’ on Weavly or Block.ly in the Control category with Repeat blocks. Learners will learn to recognize the events that can prompt the wait for conditions to take place until an event occurs or a set amount of time has passed.

Steps

Introduce conditions

  1. Place vocabulary cards in front: ‘conditionals’, ‘event’ and ‘wait for’, and review their definitions (what each word means).

  2. Review Event A and Event B where a wait for is part of the sequence. Describe what happens before, the wait time and what can happen after for each event.

    Event A:

    • What happens before: We get upset.
    • Wait time: ‘x’ time for cool down
    • What happens after: Talk about it .

    Event B:

    • What happens before: We put food in the microwave.
    • Wait time: ‘x’ time to reheat food
    • What happens after: Take food out of the microwave.
  3. Provide pictures of events where wait time takes place or ask learners to think of events where wait time is part of the event. For each event, ask learners to identify:

    • What was happening before (actions leading up to the wait for)?
    • Wait time (the pause before continuing the task)
    • What happens after that event occurs (actions taking place after wait for time)?

Model: Dash and Dot play catch

  1. Open Block.ly app.

  2. Introduce the conditionals block as the setting used to help robots, such as Dash and Dot, to stop and check for certain conditions or events before they perform the next task.

  3. Introduce the ‘Wait for’ block as the setting to help robots, such as Dash and Dot, to wait for a specific event (toss a ball) to happen before the program (playing catch) can be finished.

  4. Ask learners to imagine the list of events in a game of catch between Dash and Dot using the “wait for” block.

  5. Think aloud what steps (such as catch, toss, wait, say wee!) that Dot will do to play catch.

  6. Drag blocks to create the listed events into a sequence and use the ‘Wait for’ block on the canvas.

    • For example:

      1. Play | Dot | Catch
      2. Wait for | Dot | Toss
      3. Say | Dot | Wee
  7. Attach this sequence to the When Start block.

  8. Run program.

  9. Discuss whether prediction(s) were correct or not.

Tips

  • Test program and count the seconds for the “Wait for” out loud.

Skill Development

  • Analytical/Reasoning
  • Creative Thinking
  • Planning
  • Problem-solving (debugging)
  • Sequencing

Level Up

Add additional ‘Wait for’ conditional blocks for a more complex sequence.

Supportive Materials