Blinking an LED with the Arduino* IDE

This guide will teach you how to run a sample sketch on your Intel® IoT board using Arduino*. These instructions are geared toward the Intel® Edison module with the Arduino expansion board, but can also be applied to the Intel® Galileo board. Steps for the Intel® Edison module with mini breakout board may vary slightly.

These steps were tested using the 1.6.8 version of the Arduino IDE.

Requirements

Running Arduino

  1. Run Arduino.
  2. Open the LED blink example sketch by choosing File > Examples > 1.Basics > Blink.

    Example of the Arduino IDE

  3. Choose Tools > Board, then select your board.

  4. Select the serial device of the board from the Tools > Serial Port menu. See the instructions below for your specific OS.

    Note: The easiest way to find what port the board is using is by disconnecting your board, restarting the IDE, and re-opening the menu. The entry that disappears should be your board. Reconnect the board, restart the IDE, and select that serial port. blink-arduino-win-tools-port
  5. Once you have selected your COM port, the COM port number is displayed in the bottom right corner of Arduino. Continue to upload the sketch to your board.

    blink-arduino-win-port

Finding your port on a system with Windows*

  1. In the Device Manager, look for one of the following:
    • For the Intel® Edison board, look for an entry called Intel Edison Virtual Com Port and note the COM port number displayed next to the entry in parenthesis, which is likely to be COM3 or higher. It is NOT USB Serial Port.

      In Arduino, select your COM port. In the example below, the COM port is COM14.

      Edison_Win_usbserialport

    • For the Intel® Galileo board, look for an entry called Galileo (COMx) device under Ports (COM & LPT), as shown below.

      In Arduino, select your COM port. In the example below, the COM port is COM7.


  2. Now that you have selected your port, continue to upload the sketch to your board.

Finding your port on a system with Linux*

  1. Choose Tools > Serial Port, then select the port for your board, which is likely to be /dev/ttyACM0.

    blink-arduino-linux-tools-port

    Note: If the /ttyACM* port is not available, here are several possible reasons why:

    • The modem manager is using the port. When the port becomes active, the modem manager can claim the port, blocking the IDE's access to the port. The exact command to remove it will depend on your Linux distribution. For example, the command

      sudo apt-get remove modemmanager

      may work.
    • The /ttyACM port was not created automatically when you plugged in your board. To add the port, do the following:
      1. Create a file: etc/udev/rules.d/50-arduino.rules
      2. Add the following to the file:

        KERNEL=="ttyACM[0-9]*", MODE="0666"

      3. Restart udev by entering the following command:

        sudo service udev restart

        If you are using a virtual machine (VM), you may need to reboot Linux within the VM.

    • If you still are not able to see the port in the IDE, it may be because your user hasn't been added to the dialout group. Add yourself to the dialout group by entering the following command:

      sudo adduser your_user_name dialout       
      Then restart the IDE and try again.
  2. Now that you have selected your port, continue to upload the sketch to your board.

Finding your port on a system with Mac* OS X*

  1. Choose Tools > Serial Port, then select the port for your board, which is likely to be /dev/cu.usbmodemxxxx, where the xxxx is a string of four to five characters based on your device.



  2. Now that you have selected your port, continue to upload the sketch to your board.

Uploading the sketch to your board

  1. Click the Upload icon in the upper left to load and run the sketch on your board.

    blink-arduino-upload

  2. You should see Done Uploading and Transfer complete messages when your sketch has uploaded.

    blink-arduino-transfer-comp

  3. The DS2 LED on your board should now blink on or off every second.

Next Steps

If you have the Grove* - Starter Kit Plus: Intel IoT Edition, here's how you add sensors to your project:

  1. Navigate to the Seeed-Studio github repo, https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_V2.0.
  2. Click Download ZIP.
  3. Unzip and copy the /libraries folder to your Arduino* folder.
  4. Remove the period . in the folder name to make it: Sketchbook_Starter_Kit_V20
  5. Restart the Arduino IDE. 
  6. Connect your desired sensor and run the code.

For a good hardware primer, check out the Grove Starter Kit Wiki, which includes an overview and example code for all the hardware included in the Grove Starter Kit Plus. If you have other hardware, searching for the name of your hardware in conjunction with "Arduino" will come up with example code and libraries to use.

Note: The Intel® Edison board with the Arduino expansion board and the Intel® Galileo board can be treated as an Arduino Uno and is compatible with all Arduino Uno sensor shields. However it should be noted that Pins 10 and 11 on the Intel® Edison board are NOT in fact capable of variable voltage output (PWM), despite being marked so on the expansion board.

Para obtener información más completa sobre las optimizaciones del compilador, consulte nuestro Aviso de optimización.