Skip to main content

Lesson 4: Send Messages with Controller Input

Sometimes when sending a message from one robot to another, you want to be able to control what message is sent, and when. You can do this by coding your robot to use an input, such as a screen press or controller button, to send a message! In this lesson, you will learn how to create projects that use the One Stick Controller to send different messages depending on which controller button is pressed. 

Watch the video below to learn how to:

  • Code different messages for each controller button pressed.
  • Use a loop so that messages can be received continuously through controller button presses.

Now that you have watched the video, capture your thoughts in your journal. Answer these questions to guide your thinking and help you get ready for a whole-class discussion:

  • Why are the controller button presses part of the sending robot's project?
  • What did the receiving robot do when it received a message?
  • How do you know the receiving robot is reacting to a message from the sending robot?

Guided Practice

Next, it’s your turn to practice! You will collaborate to create projects for Robot S to direct Robot R to do five dance moves, each triggered by one of the controller buttons.

  • Use this task card (Google / .docx / .pdf) to guide your practice.
  • Don't forget to pair your controller to the sending robot! See the article linked below if you need help.

Resources for Practice:

The articles linked here are available if you need additional support while completing the activity.

 

Wrap Up

After completing the activity, it is time to share what you learned about creating robot-to-robot messaging projects that use the controller as an input. Answer the following questions in your journal to help you reflect on your learning and prepare for a whole-class discussion:

  • What did you have to think about when deciding which message to send with each button?
  • How did you match the message sent by Robot S to the right behavior in Robot R’s code?
  • How does using the controller help you control which dance move Robot R performs, and when?
  • Can you think of any other instances where using an input to control the timing of robot-to-robot messages would be helpful?

Select Next >  to move on to the Unit Challenge.