Landing : Athabascau University
  • Blogs
  • Switching from the Arduino IDE to Eclipse

Switching from the Arduino IDE to Eclipse

Switching from the Arduino IDE to Eclipse

Developing a program to control my COMP444 robotics project has snowballed past what is easily maintainable using the Arduino IDE. Having used professional IDEs for other projects, I know what a great help they can be. Despite a tight schedule and a penchant for being sidetracked by tangentially-related tasks, I decided to swap to using Eclipse (for C/C++).

Any code editor can be used to program an Arduino, even Windows TextEdit, but I was looking for the best one. Top picks according to the PYPL index include Eclipse, Microsoft Visual Studio, Vim, XCode, Sublime Text, Code::Blocks, Emacs, etc. (Tools used primarily for development other than C/C++ were excluded: Android Studio, IntelliJ, NetBeans, Komodo, Xamarin, pyCharm, etc.) Notepad++ is worth mentioning by itself as a popular and excellent option, as it's not on the PYPL index for some reason (probably too close to Microsoft Notepad for meaningful Google Analytics information). I chose Eclipse primarily because I thought I could get it working the fastest, being one of the most popular options, meaning plenty of community support, and having some experience using it in years past, while gaining all the advantages of a full IDE.

I followed Doug Schaefer's article, Program Your Arduino Like a Pro with the Eclipse C/C++ IDE. Another promising option appears to be the Sloeber plugin for Eclipse. I chose the former for no better reason than eclipse.org's (Schaefer's) article not having a reason to push one implementation over another and having better presentation. (The Sloeber page seemed sloppy, a red flag according to my prejudiced personal filter for digital content.)

Here's my steps:

  1. Download the Eclipse Installer from the Eclipse Package Downloads page, select the 64-bit C/C++ option, and complete the installation.
  2. Open Eclipse, search for "Arduino" in the Marketplace (Help > Eclipse Marketplace...), then select and install the Eclipse C++ IDE for Arduino 3.0. (Restart Eclipse.)
  3. Add platforms and libraries with the Aruduino Downloads Manager (Help > Arduino Downloads Manager) by clicking Add and selecting those you want. I picked all of the "arduino" platforms. I didn't need any libraries other than Device Control/Servo, but I also picked Communication/WiiChuck, Data Processing/Plotter, Data Processing/TimedPID, Device Control/RBD_Servo, Other/BasicLinearAlgebra, and Sensors/Analog Buttons because they looked interesting and useful for my current project.
  4. Created a new launch configuration with the Eclipse Launch Bar, clicking the dropdown that shows , then "New Launch Target...". Select Run as the initial launch mode, then Next >, select Arduino and hit Next >. Name the target, set the serial port (same as Arduino IDE, COM3 for me), pick your board and programmer (SparkFun Redboard is the Arduino/Genuino Uno and USBasp), and click Finish.
    image
  5. Create a new project: File > New > C/C++ Project > Arduino C++ Sketch; and call and place it what/whereever you wish (mine is practice-Eclipse-Arduino). Finalizing this drops us back to the workspace where we see the familiar Arduino body.
    image

  6. Now we setup the serial monitor. I wrote a short serial program to test it out:
    image
    Hit the Run button image to compile and upload it. Open a terminal with image or Ctrl+Alt+Shift+T, make sure the settings are correct, as below. (You should only have to change the Baud Rate, 9600 for the above sketch.) It should just work!
    image

image

Now that the basics are working, I should get back to work. I imagine I may have to get out of the setup() and loop() code structure, but I'll leave that path for whenever it comes up...

Comments

  • Ebony Campbell October 14, 2017 - 1:44pm

    This is a really good description of Eclipse setup. Thanks!

    I have never used Eclipse, but i use NetBeans and having a good IDE is immensely helpful. I have not got to the point in my project where I am looking at whether the Arduino IDE is enough to do the coding, But I will definitely be looking into Eclipse if I find it is not.

  • Tyler Lucas October 14, 2017 - 3:11pm

    I had trouble adding a library that wasn't in the Arduino Downloads Manager, so I wrote about it here: Using Private Arduino Libraries with Eclipse.

  • peterde October 16, 2017 - 2:21pm

    Tyler,

    I was in the same boat looking for a more robust alternative to the Arduino IDE so your post Switching from the Arduino IDE to Eclipse came at the right time. Eclipse is a great IDE and I was happy to hear there was an Arduino extension. I followed your directions as well as watching Doug Schaefer’s video demonstration

    I was also frustrated by the shortcomings in the Eclipse C++ IDE for Arduino that you mention in this blog post. The steps necessary to include your own libraries makes the product feel like a not-fully-baked solution.

    I just posted a summary of my IDE explorations and the solution I think I’m going to go with. I’d be interested to get your take on this.

     Thanks for your helpful information…

    Peter