Please enable JavaScript to use CodeHS

Pennsylvania Tech Apps and Coding

Lesson 3.4 Variables

Description

In this lesson, students will build their first physical circuit using their micro:bit devices. They will learn to use variables to control components, along with the analogWritePin and digitalWritePin commands.


Objective

Students will be able to:

  • Articulate what a variable is and why they are used
  • Assign and utilize variable in their programs
  • Create a simple circuit using micro:bit pins
  • Control an external LED by using the analogWritePin and digitalWritePin commands in micro:bit programs

Activities

These are all the activities included in the lesson

3.4.1 Variables
3.4.2 Variables
3.4.3 Variable as Coordinate Value
3.4.4 Plus with a Variable in Pseudocode
3.4.5 Exploration: Using micro:bit Pins
3.4.6 Exploration 1.4 Follow-up
3.4.7 Brightness Line using Variables
3.4.8 Opposite Blinking External LEDs
3.4.9 Dimming External LED