Where I describe how to map values in one domain to another domain.
Introduction#
Mapping is the concept of translating a range of numbers to a second range of numbers, where the second range might be smaller (typically) or larger than the first range. For example, if you had a 10-bit analog-to-digital converter (ADC) and wanted to use its values for the duty cycle of an 8-bit pulse-width modulator (PWM), you could “divide by 4” to achieve the desired results. That is, if, the range of the ADC values were 0-1024 and the desired range of the PWM values are 0-255. If not, we’ll need to map the values of the first range into the desired values of the second range. We’ll talk about both approaches in this entry.