0Pricing
Arduino & IoT Academy · Lesson

map() Values to a New Range

Rescale raw readings into useful units.

Raw Values Are Awkward

A 0 to 1023 reading rarely matches what you need. Often you want a percentage or an angle, not a raw sensor count.

Meet the map Function

The map function rescales a number from one range into another. It does the proportional math so you do not have to.

All lessons in this course

  1. Digital vs Analog Signals
  2. analogRead Returns 0–1023
  3. Read a Potentiometer Knob
  4. map() Values to a New Range
← Back to Arduino & IoT Academy