Arduino code for a self-balancing inverted pendulum