I successfully programmed the due with simple codes such as binking LED etc. I was using Programming port at that time.
Now I want to see the Due's performance with Native port. I tried programming the Native port but as soon as the sketch gets uploaded the COM port of my due changes. IDE does not even recognize that it is Due's Native port as it is not mentioned under the ports tab of tools. (Before uploading the sketch, it was mentioned)
Also even if I use SeriaUSB class, I can not see anything printing on the serial monitor.
There seems to be a driver issue, I have just spent an hour fiddling with a combination or erase/reset and drivers. Your code works.
The final thing I did before it worked was to go to the arduino drivers folder and install arduino.inf. Thing is, I had no issue 2 weeks ago when I was last playing with my Dues, I haven't even rebooted since then! I've had this sort of problem a few times now with the Due native port, it's starting to really piss me off