Wiki - Maths - Value map

Value map. The range of values ​​is from 0 to 1023, the variable W is transferred to the new limit of values ​​from 0 to 255.

With Pin A0 we get a value in the range from 0 to 1023. We overwrite the variable with a new value limit.

We send a new redistribution of values ​​to analog PWM Pin 3.

Sample program:

Download example: file.ardublock | Open Online ArduBlock

Video:

Components from Aliexpress

LED

Button

Servo SG90

Potentiometer

Arduino Pro Mini

Arduino Nano

Arduino Uno

Arduino Uno R3

Arduino Mega

Arduino Leonardo

Bread board

Training set