Programming Arduino Due using Arduino IDE | applied electronics engineering

Latest

Programming Arduino Due using Arduino IDE

By Applied Electronics - Sunday, May 14, 2017 No Comments
Programming Arduino Due is much like programming Arduino UNO using Arduino IDE. The programming language of Arduino resembles the syntax of C++ and supports most of the usual programming syntax of Arduino UNO. But if you want to write program for Arduino Due in plain C or C++ then you can use ATMEL Studio 7. Our previous post like How to program Arduino Due using user board template in ATMEL Studio 7 or How to program Arduino Due using ATMEL studio 7 covers these. There is also another option which is to use graphical programming language such as Simulink. See How to program Arduino Due using Simulink S Function for this kind of programming tutorial.

But here we are going to show how to program arduino due using arduino IDE. The steps are very simple and its same as programming arduino uno. To start with connect Arduino Due to your computer via the programming port(note that there are two usb port in arduino due- programming port and the native port). You can also use native port to upload sketches but the programming port is easier since you don't have to clear the flash to upload the code if you use the programming port.

Then once you have plugged the usb the computer should recognize the usb and your arduino due board. The next step is to fire up the arduino ide. In the IDE you would write sketches or program that tells the arduino due microcontroller ATSAM3X8E  what to do.

In the IDE, you must first select the Arduino Board which in our case is the Arduino Due.


Next you have to check that the com port is recognized and is set to correct com port number, in this tutorials its 9 but yours might be different.


After that you are good to go write program. In this tutorial we will show a simple LED blinking program. The program code is as follows.

void setup() {
  // put your setup code here, to run once:
  pinMode(13, OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(13,HIGH);
  delay(1000);
  digitalWrite(13,LOW);
  delay(1000);

}

The pin 13 on the arduino due is set to output first in the setup() function. Then in the main loop() function we write HIGH and LOW using digitalWrite() function to this pin 13. A delay of 1000millisecond between the HIGH and LOW is asserted to create blinking effect. A LED connected to this pin 13 will then turn on and off.

The final step is to compile and upload the code. To do this click on the arrow button at the toolbar.



No Comment to " Programming Arduino Due using Arduino IDE "