When writing more code than just a few lines, it might be worthwhile to invest a little bit of time to to start using a more capable editor than the one integrated in the Arduino IDE. There are several free editors around that have a wealth of features that make code editing more efficient and more pleasurable.
Read on below the video …
A nice thing of the Arduino IDE is that it allows us to choose if we want to use an external editor. This can be enabled via the menu file > preferences by setting the tick mark with Use external editor.
The editing area is greyed out now, telling us that we can’t type here anymore, we need to make changes via another editor. Once we save the file in that other editor, the Arduino IDE automatically refreshes its content and we can upload and test our changes without the need to re-open a file, or to copy / paste anything.
Of these two, Notepad++ has the shortest learning curve … actually none at all. After install it is ready for use straight away. Only when we like to use the more advanced features we will have to find out how. It is worthwhile to visit the menu settings > preferences and adjust the settings to your liking.
What are the benefits? Besides code highlighting, one of the nice features is ‘code completion’. When we start typing, a popup window shows the instructions, functions and variables that start with the first characters we typed. We can select the one we need, or we can keep typing. This is quite efficient, and it also helps to not make typo’s.
To use code completion for Arduino in Notepad++, the Arduino language plugin has to be installed. The video shows how.
Beware that for use with Arduino, when you save a file in Notepad++ the file must be saved inside a folder with the same name as the .ino file … it’s just how the Arduino IDE works.
Visual Studio Code takes a bit more effort to get started. If you like to give it a try, Google some to find tutorials how to set it up for use with Arduino.
Have fun editing.
— 0 —