A question on pull up resistors
If the button is closed then the MCU input pin is shorted to ground. There is a path from \$V_{CC}\$ to ground with resistance \$R_{1}\$ and a current flows through \$R_{1}\$. By Ohm's Law $$V = IR$$ so the current \$I\$ through \$R_{1}\$ is $$I = \frac{V_{CC}}{R_{1}}$$ and is non-zero.

If the button is open and the MCU input pin has a high impedance then very little current will flow through \$R_1\$. Since \$I \approx 0\$ in this case the voltage across the resistor is approximately \$0\$. The voltage at the MCU input is therefore "pulled up" to \$V_{CC}\$.

Without the resistor (i.e. \$R_{1} = 0\$) the MCU pin would simply be shorted to \$V_{CC}\$ and could never be "pulled down" by the button switch. If the button switch was closed then the current drawn from \$V_{CC}\$ would be $$I = \frac{V_{CC}}{R_{1}} \approx \frac{V_{CC}}{0} = \infty$$