2 – Robot Coding

🎯 Learning Objectives

Develop the Programming & Development, Algorithms Learning Strands:

  • You will understand the constructs of sequencing, selection, and iteration programming
  • Develop a physical computing solution using a micro:bit for navigating a robot around a set course
  • Learn how to design a workflow diagram and the importance of pre-planning project
πŸ’¬ Key Vocabulary
  • micro:bit
  • algorithm
  • workflow diagram
  • sequencing
  • iteration
  • function
  • robot

πŸ“ Starter Activity – Tracing a Letter

Last lesson you learned how to program the robot to drive forward and turn in both left and right directions.

A robot has been programmed to follow the outline of a letter of the alphabet. Opposite is the code the programmer used to move the robot

  • The robot will start facing left
  • Following these command blocks can you identify the letter of the alphabet that the robot will trace out?
  • Now think about how you would extend the code to create a different letter

Think and work it out first, then share your thoughts with the person sitting next to you.

///

πŸ“– Complete the Course Challenge

Complete the course, be first across the line

Your teacher will put you in a group of 3. As a group, you will program your micro:bit robot to complete a course set out by your teacher.

There are rules that you will need to follow:

  • The robot must start in the Start box
  • The robot must stop in the Finish box
  • The robot must not go outside of the course boundaries as it moves around the course
  • The robot must not fall off the table!

Before you begin programming the micro:bit make sure you know the course layout and think about the sequence of instructions you will use to make the robot complete the course without breaking any of the rules above.

  • Each group member must create their groups programming code on the micro:bit website (https://makecode.microbit.org/) to upload as evidence for their badge.
  • You will have a single robot per group but each group member will have their own micro:bit to program for the robot.
  • The robot will use one micro:bit at a time but make sure each team member has a turn at using their micro:bit within the robot.
  • Make sure each group members code is the same.

πŸ“Silver/Gold Badge Activity – Lights out and away we go!

Download the Workflow Worksheet and plan the sequence of instructions you will use when programming your robot

In your groups, program your micro:bit robot to complete the course following the rules above.

Look back at Lesson 1 for any help with the coding, the website is https://makecode.microbit.org

If you complete the course but your robot touches a line or cuts a corner then upload the coding evidence to the Silver Badge

If your robot successfully completes the course without breaking any rules then upload the coding evidence to the Gold Badge

πŸ“Platinum – Over to you, designer!

Next lesson you will design a new course layout for your robot to navigate.

Open a new Word document and write how you would plan on programming your robot to complete the course you design.

Make sure to include:

  • How will you identify the sequence of instructions you need?
  • How will you use the Workflow diagram to help plan before you program?
  • What hardware and websites will you use to help program the robot?
  • Would you add or remove any rules to make it easier or harder?

In this lesson, you…

  • Created a Flowchart diagram to sequence to instructions for your robot
  • Programmed your micro:bit robot to navigate a course

Next lesson, you will…

  • Design a course
  • Program your micro:bit robot to complete the course
  • Write an evaluation of how you performed within a team

πŸ… Badge it

πŸ₯ˆ Silver Badge
  • Your robot completes the course but breaks the rules, upload a screenshot of your code to Bourne to Learn.
πŸ₯‡ Gold Badge
  • Your robot completes the course without breaking the rules, upload a screenshot of your code to Bourne to Learn.
πŸ₯‰ Platinum Badge
  • Upload a screenshot of your course design and Word document to Bourne to Learn.