How to create and edit source files for Arduino IDE
This article mainly shows you "Arduino IDE how to create a new edit source file", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "Arduino IDE how to create a new edit source file" this article.
Arduino IDE new source file
By default, a new source file is created after Arduino IDE starts, as shown in figure 2.20. The new source file name starts with sketch_ with the month abbreviation, date, and letters from a to z. For example, the file name shown in figure 2.20 is sketch_mar09a. After you create a new file, its default name is sketch_mar09b, as shown in figure 2.21.
Figure 2.20 newly created source file figure 2.21 naming rules for new files
New files can be created through New on the File menu or by using the shortcut key Ctrl+N, as shown in figure 2.22.
Figure 2.22 New
Arduino IDE Editing Source File
Editing source files is arguably the most commonly used feature in Arduino IDE. Editing the source file can be done directly in the editing area of Arduino IDE, and if you have more handy editors such as Notepad++, Vim, and Emacs, you can do this by enabling the "use external editor" option. This configuration is done in the preferences dialog box that pops up from the File menu-> preferences command, as shown in figure 2.23.
Figure 2.23 using an external editor
When this option is enabled, Arduino IDE's editor becomes uneditable (the editing area is dimmed), as shown in figure 2.24.
Figure 2.24 Editing prohibited
So at this time the source file can only be edited through an external editor, the source file can be shown in figure 2.25 "Sketch" menu "Show Sketch folder" or the shortcut key Ctrl+K to open the folder where the source file is located, as shown in figure 2.26.
Figure 2.26 folder where Sketch is located
Here you can open the file through your favorite editor, as shown in figure 2.27 using Emacs.
Figure 2.27 Editing using Emacs
Here is a hint that Emacs users can use C language mode to edit and highlight Arduino source files. The command to switch C language mode is Mmurx c-mode.
The above is all the contents of the article "how to create a new edit source file for Arduino IDE". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!