Changed the Arduino code. It works now, some bugs still present they are mainly due to my attempt at a button. Should be fixed soon. Issues with calibration such as knowing when to calibrate white and black but should be fixable with some sort of message in the java GUI. The light interferance issue has been theoretically fixed but a case still has to be made.