Lesson Template

Digital I/O

Read buttons and control LEDs using digital pins.

Progress

24% completed

Lesson Overview

This lesson introduces the core ideas behind Digital I/O.

  • pinMode()
  • digitalWrite()
  • digitalRead()

Example Code

pinMode(2, OUTPUT);
digitalWrite(2, HIGH);
delay(500);
digitalWrite(2, LOW);

Lessons in This Section

Lesson 13 - Understanding Digital Input in Arduino

Learn how to read buttons and switches using pinMode(), INPUT/INPUT_PULLUP, and digitalRead().

Open Lesson

Lesson 14 - Understanding Digital Output in Arduino

Learn how to control LEDs and other ON/OFF devices using pinMode(), digitalWrite(), and delay().

Open Lesson