mBot: Functions (Grade 5-6)


In this lesson, students will be introduced to “My Blocks” – functions. As students have increased programming knowledge and skills, they are able to create more interactive projects which may involve complex structures in their code. This learning activity will explain the use of functions by starting with two unplugged activities in Warm Up and Phase 1. Then, in the next phase, students will instruct mBot the automated driving vehicle by using functions.


  • Explain the meaning and use of conditionals (“if” statement in particular) associated with the relevant real-life examples.
  • Explain the meaning of different Boolean programming scripts in the context of conditionals.
  • Develop simple conditional algorithms of their own that demonstrate their practical understanding of the learned control structures.

Curriculum Connections Summary

  • Ontario - Mathematics - Algebra (Coding) & Science
  • Quebec - Science
  • New Brunswick - Science
  • Nova Scotia - Science & ICT
  • Alberta - Science & ICT
  • British Columbia - Science & ADST
  • Manitoba - Science
  • Prince Edward Island - Science
  • Saskatchewan - Science
  • Newfoundland & Labrador - Science
  • Yukon Territories - Follow's B.C.'s Curriculum
  • Northwest Territories - Follows Alberta's Curriculum
  • Nunavut - Follows Alberta's Curriculum

Find Out More


mbot is the best of both worlds, transitioning students from Scratch Blocks to Text Code