Calculating Arduino Write Values

Linear Equation

We must scale our read values (0 to 1023) to suitable write values (0 to 255).

The math above shows how to derive an equation that allows us to calculate a suitable write value (0-255) from a read value (0-1023) on an arduino microcontroller.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.