Transfer program from MEGA to DUE

Sure . It is slower and you will have to write the routines yourself. I don't know if speed is critical here.