Please enable JavaScript to use CodeHS

Introduction to Physical Computing with micro:bit

Lesson 2.5 Functions

Description

In this lesson, students will use their first external sensor, an ultrasonic range finder, to measure distance and control components in the programs. They will develop and use functions with and without parameters to more clearly organize their code and make it more reusable.


Objective

Students will be able to:

  • Use functions with and without parameters to create more organized and reusable programs
  • Use an ultrasonic range finder to sense distance and control components in their micro:bit programs