Saving Arduino sketch problems

Making a Aduino sketch and saving the .ino to my computer is OK No probs'

However when I reload the .ino to the IDE to work on or modify it , the original saved .ino on the computer is modified each time i compile a revised work copy of the ino file.

This means the file is updated every time I work on the original and click "compile".

Is there any way I can stop the " original " .ino file from being modified Unless I select the "Save" feature'

The revised file has to be saved before it can be compiled.

If you wish to be able to revert to an older version just make a copy of the folder containing your project.

...R

Is there any way I can stop the " original " .ino file from being modified Unless I select the "Save" feature'

Take a look in File/Preferences in the IDE and uncheck "Save when verifying or uploading"

HI,
This is where programming discipline comes in.
After any major change store your code as the next version.
EG;
Code_1
Code_2
Code_3

Another tip is in the setup(), place a
Serial.begin(115200);
Serialprintln("===Code_1===");

This will output on the serial monitor in the IDE the code name, this way if you are not sure what code you have in the controller it is just a case of connecting the USB cable opening the monitor, if the controller is powered up it will RESET and setup() will send the Serial.print.
Some types of controllers like ESP32 will need to be manually reset, to rerun the setup() part of the code.

Tom... :slight_smile:

Thank you Helicopter Bob. Exactly the information I needed. Appreciated