Lesson Template

Variables & Constants

Store values safely with clear names and const pins.

Progress

18% completed

Lesson Overview

This lesson introduces the core ideas behind Variables & Constants.

  • int and bool
  • const for pin numbers
  • Updating values

Example Code

const int ledPin = 2;
int blinkDelay = 500;
bool isEnabled = true;

Lessons in This Section

Lesson 1 — Understanding bool and boolean in Arduino

Learn how true/false values work and how they control LED and button states.

Open Lesson

Lesson 2 - Understanding int Data Type

Learn how int stores whole numbers for counters, sensor readings, and timing values.

Open Lesson

Lesson 3 - Understanding long Data Type

Learn how long stores larger whole numbers like millis() time values and larger counters.

Open Lesson

Lesson 4 - Understanding unsigned int Data Type

Learn how unsigned int stores only positive whole numbers for counters and values that never go below zero.

Open Lesson

Lesson 5 - Understanding unsigned long Data Type

Learn how unsigned long stores larger non-negative numbers for millis() timing and long-running counters.

Open Lesson

Lesson 6 - Understanding char Data Type

Learn how char stores single characters like letters, numbers, and symbols in Arduino/ESP32 sketches.

Open Lesson

Lesson 7 - Working with String and String()

Learn how to store text with String, create text using String(), and combine messages for Serial output.

Open Lesson

Lesson 8 - Understanding float Data Type

Learn how float stores decimal numbers for sensor measurements, percentages, and calculations.

Open Lesson

Lesson 9 - Understanding double Data Type

Learn how double stores decimal numbers and how it compares with float for precision-focused calculations.

Open Lesson

Lesson 10 - Understanding short Data Type

Learn how short stores smaller whole numbers, when it can save memory, and how it compares with int.

Open Lesson

Lesson 11 - Understanding word Data Type

Learn how word stores non-negative values, how it compares with unsigned int, and when it is useful for compact positive data.

Open Lesson

Lesson 12 - Understanding Arrays in Arduino

Learn how arrays store multiple values of the same type and how indexing helps manage repeated data.

Open Lesson