by Steven B. Combs, Ph.D.
In a previous post I demonstrated the install of the Arduino IDE on a Peppermint OS 4 install. Today I want to take this a bit further and show you how to create an Arduino programming environment that knocks the socks of the original Arduino IDE.
Before you begin, you must have Java and the official Arduino IDE software installed on your Peppermint OS box. Directions are here. Once that process is complete, click the link below to learn how you can use Sublime Text 2 and a package known as Stino to upgrade your Arduino programming environment.
I will use Peppermint OS; however, these instructions should work with most Debian based Linux distributions.
I will not go into a long rant on why Sublime Text 2 is my go to text editor on both Linux and Mac. A quick Google search will yield many blog posts that handily take care of this task. Quickly though, Sublime Text 2 includes features that the original Arduino IDE simply does not, such as:
That last bullet, packages, is the vital component. It allows us to add additional features to the base install of Sublime Text 2. The Stino package simply adds the controls we need to write, compile and upload our code to an Arduino.
You can also configure a Mac with the same setup. My first use of Sublime Text 2 and the Stino package was on a Mac and the install is similar. Seasoned Mac users will be able to complete an install with relative ease. If there’s a need for a Mac version of this post, drop a comment below. And “yes,” this same setup can be accomplished on a Windows box. Please don’t ask me for instructions though. I haven’t had access to a Windows machine in over three years.”
The heart of our new enhanced Arduino IDE is Sublime Text 2. As the time of this writing, a beta version of Sublime Text 3 is available. These instructions will not work for this version; however, savvy Linux users can probably modify my instructions to get a functional install. Let’s begin and install Sublime Text 2 on Peppermint OS.
sudo apt-get install sublime-text–2
Peppermint OS will search for all dependencies and software necessary for the install.
Some seasoned Linux users may wonder why we don’t need to install repositories (or server locations that contain the software). Peppermint OS already includes them! Yet another reason Arduino fans should consider Peppermint OS as their Linux distro of choice.”
Yat the prompt.
Let’s verify our install of Sublime Text 2 and make sure things are operational.
Those familiar with basic text editors will find Sublime Text 2 familiar. The lack of icons and buttons may confuse new users. Hang in there and trust me. Once we get those Arduino controls in there, it will all begin to make sense.
“If you are curious about Sublime Text 2 usage and features, let me suggest this series of videos.”
Now that we have a functional Sublime Text 2 install, its time to make it Arduino aware. We utilize the package feature of Sublime Text 2 to do this. Natively, Sublime Text 2 does not include a package manager; however, the folk(s) over at https://sublime.wbond.net have created the standard in Sublime Text package managers.
Package Manager makes it easy to add other features to Sublime Text 2 as you become more comfortable with its use in other activities besides Arduino programming.
With the install of the Package Manager in the previous section, this is now an easy task.
Activate the Command Palette using
Package and use arrow keys and select the Install Package option.
return. The status bar at the bottom of the page will display an animated prompt while it updates the repository listing as shown in the image below.
An alphabetical list of packages appears.
arduino. The list will narrow down the available options.
Use the arrow keys to select the Arduino-like IDE package.
return. Package Manager will download and install the package.
An Arduino menu item will appear on the right-hand side of the Sublime Text 2 main menu as shown in the image below.
Stino package the location of the official Arduino IDE install. Stino is Sublime Text 2 conduit to that software and it’s libraries. Make sure you have the Arduino IDE installed before completing the steps below.
Select Arduino / Preferences / Select Arduino Application Folder from the Sublime Text 2 main menu. A prompt will appear.
return and the prompt will display the home account file structure.
Navigate using either the keyboard or the cursor keys to the following location:
return. This will set the location of the Arduino IDE and its libraries.
Attach an Arduino board to your Peppermint OS box via a USB cable.
Don’t have an Arduino? Get a great deal on an Arduino at Amazon.
Connect an Arduino to complete the final steps.
Select Arduino / Serial Port / /dev/??? from the Sublime Text 2 main menu. There should be a single entry where ??? is a substitute for something similar to ttyACM0.
Select Arduino / Arduino AVR Boards from the Sublime Text 2 main menu and select the board attached to your computer.
Well, that wasn’t too bad. Now the moment we have all been waiting for!
Finally, we will enter, compile and upload our first program to an Arduino board. I will make things easy and include some sample code for you to use. The Arduino program below will blink the on-board LED.
Save the code to any location you desire (Desktop maybe???) and give it the name Blinky.ino. Stino will compile the package and upload it to the Arduino.
You will have a blinky Arduino as shown in the image below.
You are now ready to use the Stino package to create an amazing new physical computing project. And when you do, please share it in the comments below.
New users to Linux have learned the basics of Linux software installation, Sublime Text 2 package management and Stino Arduino package use. In fact, if you “sorta/kinda” understood what were were doing, you have the skills to experiment with some other interesting installs and configurations. If nothing else, you now have installed on your Peppermint OS (or other Debian distro variant) what I consider to be the most powerful Arduino development platform available.