Issak Sdu
Member level 1
Problem statement
i'm using 10bit ADC to measure the voltage on potentiometer (real angle of rotation of a DC motor, which varies from -45° to +45° or 0° to 90°).
i'm using 16bit Timer to measure the width of a square signal (desired angle of rotation of the DC motor, which varies from 1ms to 2ms like RC servos).
i want use integer calclations in order to avoid converting my results of ADC and Timer into real numbers.
Question
How can i rescale the 10bit result from ADC to its corresponding 16bit result from Timer ?
i'm using 10bit ADC to measure the voltage on potentiometer (real angle of rotation of a DC motor, which varies from -45° to +45° or 0° to 90°).
i'm using 16bit Timer to measure the width of a square signal (desired angle of rotation of the DC motor, which varies from 1ms to 2ms like RC servos).
i want use integer calclations in order to avoid converting my results of ADC and Timer into real numbers.
Question
How can i rescale the 10bit result from ADC to its corresponding 16bit result from Timer ?