Updated the Arduino Due code by just replacing it with the commented out code I had tested earlier.