With this planar robot you can play with forward and inverse kinematics and control algorithms. This is not the best way to make a precise double SCARA but it is a way to learn the closed loop control of a DC motor coupled with an encoder and at the same time the kinematics concepts in robotics.
Three libraries are needed to start running the program with the optical mouse:
If you want to control the robot with the mouse (It can be controlled with many other interfaces like touchscreens, joysticks or sending trajectories form a vector) you need this library:
The motor driver library (Other motor driers can be used such as L298N):
The PID Controller library to control the motor position in closed loop with the encoder position: