Click here to Skip to main content
15,881,803 members
Articles / Internet of Things
Article

Blinking an LED with the Arduino IDE

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
11 Jun 2015CPOL5 min read 10K   1   1
This guide will teach you how to run a sample sketch on your Intel® IoT board using the Arduino IDE.

This article is for our sponsors at CodeProject. These articles are intended to provide you with information on products and services that we consider useful and of value to developers

Get access to the new Intel® IoT Developer Kit, a complete hardware and software solution that allows developers to create exciting new solutions with the Intel® Galileo and Intel® Edison boards. Visit the Intel® Developer Zone for IoT.

Overview

This guide will teach you how to run a sample sketch on your Intel® IoT board using the Arduino IDE. These instructions are geared toward the Intel® Edison module with the Arduino* Expansion Board, but can also be applied to the Intel® Galileo board.

Requirements

Setup

1. Run Arduino.

Image 1

Figure 1 - Open arduino.exe.

2. Open the LED blink example sketch: File > Examples > 1.Basics > Blink. You should see a window like in Figure 2.

Image 2

Figure 2 - Load Blink Example in IDE.

3. Choose Tools > Board, then select your board, like in Figure 3.

Image 3

Figure 3 - Select Intel® Edison from the Tools>Board menu

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 the Intel Edison board. Reconnect the board, restart the IDE, and select that serial port.

On Windows*

One easy 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 the Intel® Edison board. Reconnect the board, restart the IDE, and select that serial port.

The port is likely to be COM3 or higher and is called "Intel Edison Virtual Com Port" in the Device Manager, like in Figure 4. It is NOT "USB Serial Port". COM1 and COM2 are usually reserved for hardware serial ports. Select your COM port, as shown in Figure 5.

Image 4

Figure 4 - Select Intel Edison Virtual Com Port (COM#)

Image 5

Figure 5 - Select COM port from Tools>Serial Port menu is using Windows*

Now the bottom right should match the COM port number of the 'Intel Edison Virtual Com Port (COM#)" from the Device Manager, like in Figure 6.

Image 6

Figure 6 - The COM number should match the Intel Edison Virtual Com Port (COM#)

Once you have selected your port, continue to upload the sketch to your board.

On Linux*

The port is likely to be /dev/ttyACM0, like in Figure 7.

Image 7

Figure 7 - Select /dev/ttyACM0 from the Tools>Serial Port menu is using Linux*

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

  • Modem manager is using the port. When the port becomes active, 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:

a. Create a file etc/udev/rules.d/50-arduino.rules

b. Add the following to the file

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

c. Restart the udev with 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
sudo adduser your_user_name dialout

Then restart the IDE and try again.

Once you have selected your port, continue to upload the sketch to your board.

On Mac OS X*

The port is likely to be /dev/cu.usbmodemxxxx, like in Figure 8.

Image 8

Figure 8 - Select /dev/cu.usbmodemxxxx from the Tools>Serial Port menu is using OS X*

5. Click the Upload button in the upper left to load and run the sketch on your board, like in Figure 9.

Once 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.
  2. You should see Done Uploading and Transfer complete messages when your sketch has uploaded.

    Image 9

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

    Image 10

Next Steps

If you have the Grove Starter Kit Plus Intel IoT Edition, here's how you add sensors:

1. Navigate to the Seeed-Studio github repo, https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_V2.0.

2. Click Download ZIP (see Figure 12).

Image 11

Figure 12 - Navigate to Seeed-Studio github.

3. Unzip, and copy to /libraries folder in 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.

Troubleshooting

Resources

For more resources visit the Intel® Edison Developer Resources page

Blink Without Delay Example

Intel® Developer Zone for IoT

Start inventing today with the Intel® IoT Developer Program which offers knowledge, tools, kits and a community of experts to quickly and easily turn your innovative ideas into IoT Solutions.

Dream it, Build it with the Intel® IoT Developer Kit for Intel® Edison and Intel® Galileo platforms. These kits are versatile, performance-optimized and fully integrated end-to-end IoT solutions supporting a variety of programming environments, tools, security, cloud connectivity and hardware.

For more resources and to learn how the new Intel® IoT Developer Kit v1.0 can help streamline your IoT projects:

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
You may know us for our processors. But we do so much more. Intel invents at the boundaries of technology to make amazing experiences possible for business and society, and for every person on Earth.

Harnessing the capability of the cloud, the ubiquity of the Internet of Things, the latest advances in memory and programmable solutions, and the promise of always-on 5G connectivity, Intel is disrupting industries and solving global challenges. Leading on policy, diversity, inclusion, education and sustainability, we create value for our stockholders, customers and society.
This is a Organisation

42 members

Comments and Discussions

 
QuestionVoting of 5 Pin
Ganesan Senthilvel16-Jun-15 18:54
Ganesan Senthilvel16-Jun-15 18:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.