Final version of the working arduino code.