Code for a self-balancing inverted pendulum robot based on an arduino (ATmega168)