This article describes how to set up Eclipse Arduino IDE (Sloeber) to be able to develop programs on a Windows computer for Arduino Mega. It should work also for other AVR-based Arduinos.
I probably don’t need to tell you why use Eclipse instead of the Arduino IDE. If you plan to create more complex project with your Arduino or even see yourself as an embedded software developer someday, you will soon outgrow the Arduino IDE. And then there are two main options: Eclipse or Atmel Studio. If you read this, you probably decided for Eclipse, which is choice I like myself too.
We will need the following tools:
- Eclipse Arduino IDE (Sloeber) (https://github.com/Sloeber/arduino-eclipse-plugin/releases/tag/V4_1 )
Here are the installation procedures:
Eclipse Arduino IDE
Download the software from https://github.com/Sloeber/arduino-eclipse-plugin/releases/ . The latest stable version (June 2017) is V4.1. Download the zip file and extract it to any folder on your computer, for example, to C:\Sloeber.
To start Eclipse Arduino IDE, go to the extract folder (C:\Sloeber) and run sloeber-ide.exe.
You may want to create link on your desktop for quick access.
When Eclipse starts, you need to select location for your workspace. This is a folder on your computer where all your projects will be located. Later you can use several workspaces and change the default location, but for now I recommend just accepting the default offered by Eclipse and moving on.
At this point Eclipse will download all the necessary configurations into the C:\Sloeber\ arduinoPlugin folder. Relax and wait for it to complete
This section describes how to create project with Arduino MCU Framework (the software library), so that you can use the Arduino functions in your program.
- Go to File > New > New Arduino sketch.
- Enter name of your project, for example, Blink and click next.
- In the next step select the platform folder, the board and the processor. Leave the Upload protocol as Default and click Next
- In the next step select the sketch template and click finish
We now have an empty project and will add links to the Arduino files into the project.
Paste the following code into the Blink.ino file:
The project should built without errors, there may be some warnings in functions but these have no effect on our program. The build may take little longer first time because all the Arduino core functions are built, but later, the compiler is smart enough to build only changed files, so it takes only few seconds to build the program.
First, connect the Arduino board to your computer. Give the computer enough time recognize the board.
Right click on the project and select properties. In the property window click Arduino and set the port and click Ok
Finally go to Arduino menu and select Upload Sketch.
You should now see that the LED on your Arduino is blinking. This means our program is running.