Have you searched for material related to adc and due?
Also..... could you please explain what this line in your code is meant to do?.....
while (i0 < 1000 || i1 < 1000);
Should add some documentation (ie. comments) in your code.
Also, the lines in that particular section are all commented out .... by the symbols //
Why is a significant portion of the code commented out?