Theory: A voltage divider uses two resistors in series to step down a voltage. \(V_{out} = V_{in} \times \frac{R_2}{R_1 + R_2}\). The code solves this standard equation. Read more on Wikipedia