The Due is different from the Uno in many very significant ways. While I'm sure that the people in this Due forum could help with your issue, in an effort to keep things organized it makes sense to move your question to a more appropriate forum. A moderator may be able to take care of this for you.
A word to the soon-to-be-wise: google is quite a bit more useful for the purpose of finding example sketches. There are surely dozens of examples out there of people doing exactly what you want to do. Since it's sortof robotics related, there may be hundreds
. If you need help understanding ones that you find, perhaps that would be a more appropriate time to ask for direct help. Don't be afraid to experiment! You will learn much more through trial-and-error than through question-and-answer. Good luck with your new project!