Blockly Controls (Sensors)

Lesson Eleven

Introduction

Dash is a very complex robot that can sense things happening around it. Just like our five senses (sight, touch, hearing, taste, smell) Dash also has senses and sensors. Today we will be making Dash respond to buttons being pressed on the body of the robot, respond to sounds, respond to being picked up, and respond to getting too close to something.

Teacher Demonstration

 

  1. Explain that Dash has sensors just like we do. It can sense things happening in the world around him.
  2. Model connecting Dash to the Blockly application
  3. Model selecting the “Wait for Dash Top Button” command
  4. Model changing parameters
  5. Model the different choices: Each button on body being pressed, Proximity to an object in front of Dash, Clap, Voice, Picked up, Touches an object in front
  6. Explain that dash can respond to the same sensations when using a repeat block “Repeat until Dash Top Button”
  7. Explain the “If” block by saying that you can write a command that makes Dash do an action but if it, for example, hits into a wall, Dash turns right 180 degrees.
  8. Explain the “If Else” block by using the example that you want Dash to drive forwards until it hits a wall in front of it and then turns right 90 degrees.

 

Extension Activity 

Camper grouping: Pairs (High/low campers together)

Have camper pairs go to 5 different stations. Each station will practice a different skill.

  1. Campers will write a program that makes Dash wait until (insert one of the choices from #5 above) for it to move to the next command.
  2. Campers will write a program that will make Dash repeat until (insert one of the choices from #5 above) for it to move to the next command.
  3. Campers will use an “If” block to make Dash drive forwards and if it hits into a wall turn left 135 degrees.
  4. Campers will use an “If Else” block to have Dash drive forwards and if it hits into an object, turn right 135 degrees.
  5. Campers will write a program that includes all commands reviewed today (numbers 1-4).

There is much to be absorbed up to this point. If you feel more practice is necessary for the 3rd to 5th graders with any of these commands, use Thursday and Friday of week 3 for additional reinforcement. If the campers grasp the concepts in these lessons, move forward with what is on the schedule.