Editing...

The Arduino IDE is a complete Independent Development Environment but, its editor is very simple and only adequate for simple projects. Anyone writing code for anything other than a short basic sketch should really consider another approach to writing code. That said, I read a lot of nonsense about the Arduino IDE and I really think that some people need to realise that not everyone is into command-line compiling and using IDEs that require a University degree to understand. Some mere mortals just want to be able to write a sketch and upload it to an Arduino board!

My personal feeling is that Arduino don't have much interest in spending the time necessary to make a really good IDE. It does do an excellent job of programming and uploading sketches and bootloaders but, the editor is really not good enough They have produced an acceptable IDE in version 1.0.x but, the latest 1.5.x version is more cosmetic than groundbreaking for the average user unless you dig beneath the surface where you will find a very powerful tool albeit with the same dreadful editor. Arduino have missed so many opportunities such as adding support for the Amega328-PU. The Arduino IDEs are fine for simple, no fuss, projects but serious users will soon need to move on!

Luckily, Arduino gave us the ability to use an "External Editor" which means that we can use the Arduino IDE to upload sketches to our AVR devices and Arduino boards as well as load bootloaders but, use a better tool for actually creating and editing the code.

We could use the ATmel Studio which is a complete IDE in its own right but many users may find it a little daunting. It's a learning curve worth taking though as the power of ATmel Studio worth the effort!

Notepad++:

If you aren't already using it, I would recommend getting a copy of "Notepad++"* which is a very powerful text editor which has the added advantage of being configurable to recognise and highlight Arduino keywords. *(other editors are available).

The Arduino IDE remains as the tool to upload and program the code onto AVR devices and Arduino boards but all the code editing is done in a friendlier environment.

With "Use external editor" selected in the Arduino IDE preferences, it is simply a case of opening the sketch to be edited in both the Arduino IDE and Notepad++, editing the code in Notepad++ and saving it. The Arduino IDE will recognise that the code has changed and refresh itself when "Verify" or "Upload" is chosen.

So, code editing takes place in Notepad++ and compiling and uploading takes place within the Arduino IDE. Try it, it's so easy!

To make Notepad++ recognise and highlight Arduino keywords, download the "Notepadpp_update" archive and extract the files to a folder of your choice. The archive will contain 2 files as follows:

"notepadpp_arduino_language_file_1.txt" and "notepadpp_arduino_language_file_2.txt". There is only a single line of text in each file.

 

Select the "Settings" menu and then " Style Configurator" and the window shown on the left will appear.

In the "Language" column, select "C++".

In the "Style" column select "INSTRUCTION WORD".

Open the "notepadpp_arduino_language_file_1.txt" file with a text editor.

Copy the entire line it contains.

Now paste the copied line of text into the box labeled "User defined keywords" as shown.

Close the text editor.

In the "Style" column select "TYPE WORD".

Open the "notepadpp_arduino_language_file_2.txt" file with a text editor.

Copy the entire line it contains.

Now paste the copied line of text into the box labeled "User defined keywords" as shown.

Close the text editor.

Type "ino", without the quotes, into the "User ext. :" box.

You could alternatively add "ino pde" instead.

The colours of the highlighting can also be altered as you wish.

Click the "Save & Close" button.

After performing the patch, any Arduino "ino" sketch you open will have all of its keywords highlighted. If you start a sketch with Notepad++ you will have to select "C/C++" from the language menu first.

Thanks to "Riva" for this excellent work!