The Arduino code editor does NOT autosave as you type (though you can turn this feature on in the web editor), so be sure to periodically save your code as you work. However, the Arduino code editor will save your code when verifying or uploading it.
At the top of the code editor panel, hover your mouse cursor over the button with 3 dots, and then select "Save" from the pop-up menu.
TURN ON AUTOSAVE: You can turn on autosave in the Arduino Create web editor (but not the desktop editor). Click the Preferences menu in the left navigation to display its menu options. Be sure "Enable Autosave" and "Save when verifying and uploading" are both checked.
Under the File menu, select "Save" – alternatively, you can click the Save icon (looks like a downward arrow) at the top of the code editor window.
By default, a new sketch will be given a generic filename that starts with sketch_
and includes the current date (plus a letter, such as: a
, b
, c
, etc.).
You should rename your new sketch to give it a filename that will make it easy for you (or anyone else) to identify and find the program later.
Hover over the 3-dot button at the top of the code editor panel, and then select "Rename Sketch..."
In the pop-up, replace the generic sketch name with a unique filename.
Use a name that will make it easy for anyone to identify this sketch later (especially once you have multiple sketches saved in your Arduino account).
The filename cannot contain spaces (instead you can use an underscore as a "space").
Your teacher might have a specific filename format that you should use for certain programs.
Click the OK button to save the new name and close the pop-up.
Rename New Program (not yet saved): Under the File menu, select "Save". A pop-up dialog window will appear. Enter a new filename, and then click the Save button.
Rename Existing Program (previously saved): Click the down arrow icon in the top-right corner of the code editor window, and then select "Rename" in the drop-down list. A small dialog will appear at the bottom of the code editor window. Enter a new filename, and then click the OK button.
You can use the "Save As" command to save a copy of an existing app as a new app with a different name. This is a useful way to copy an app and then modify its code.
Hover over the 3-dot button at the top of the code editor panel, and then select "Save As."
In the pop-up, replace the existing sketch name with a new filename.
Click the OK button to save the new app and close the pop-up.
Under the File menu, select "Save As". A pop-up dialog window will appear. Enter a new filename, and then click the Save button.