Lesson Template

Conversion

Convert values safely between data types and text formats.

Progress

0% completed

Lesson Overview

This lesson introduces the core ideas behind Conversion.

  • Type casting
  • String to number
  • Number to String

Example Code

int raw = 1023;
float voltage = (float)raw * 3.3 / 4095.0;
String text = String(voltage, 2);

Lessons in This Section

Lesson 60: Using byte() Conversion

Learn how byte() converts values to 8-bit range, how casting behaves, and how to avoid overflow wrap-around.

Open Lesson

Lesson 61: Using char() Conversion

Learn how char() converts numeric values into character codes for text, symbols, and lightweight serial protocols.

Open Lesson

Lesson 62: Using float() Conversion

Learn how float() converts values into decimal-capable form for precise division, scaling, and sensor calculations.

Open Lesson

Lesson 63: Using int() Conversion

Learn how int() converts values into whole numbers, removes decimal part, and supports safe numeric casting.

Open Lesson

Lesson 64: Using long() Conversion

Learn how long() converts values to a larger integer type for millis timing, counters, and overflow-safe arithmetic.

Open Lesson

Lesson 65: Using (unsigned int) Conversion

Learn how (unsigned int) casting creates non-negative integer values and how wrap behavior affects conversions from negative inputs.

Open Lesson

Lesson 66: Using (unsigned long) Conversion

Learn how (unsigned long) casting creates large non-negative integer values and how wrap behavior affects conversions from signed inputs.

Open Lesson

Lesson 67: Using word() Conversion

Learn how word() casts values into 16-bit unsigned form, how wrap-around behaves, and when to use it for compact timing and packed data.

Open Lesson