Create a new Project

  1. Open the Arduino IDE
  2. Click on File
  3. Then New
  4. Highlight everything ( By Pressing Command-A )
  5. Paste the following code

/*
  Blink

  Turns an LED on for one second, then off for one second, repeatedly.
  https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
*/

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.

  #define LED2_DATA_PIN 16

  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(LED2_DATA_PIN, OUTPUT);

  Serial.begin(115200);

  Serial.println("Setup done");

}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(LED2_DATA_PIN, HIGH);   // turn the LED on (HIGH is the voltage level)

  delay(1000);                       // wait for a second

  Serial.println(LED_BUILTIN);

  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(LED2_DATA_PIN, LOW);    // turn the LED off by making the voltage LOW

  delay(1000);                       // wait for a second

}

Save the Program

  1. Click on the File Menu again
  2. Then Chose Save As
  3. Type in "Blink Both Leds"

Upload the Sketch

  1. Click on the Sketch Menu
  2. Then Upload.

Taken from this web site

Arduino Example Site