Is there a history of compiled programs? I have 3 sketches loaded into my Arduino 2.0.4 IDE and one of them I downloaded ("uploaded" in Arduino parlance) works well in my project. The changes between the 3 programs is very subtle so I want to know what the last download was. Is there a log file I could check Windows 11?
I don't suppose there's a verify where I could compare code in the UNO with compiled code on the Windows computer? (In assembly days, one could do this).
Such a thing is only possible if you program it. Have each of your program print a version number when they start executing.
Consider Winmerge.
WinMerge - You will see the difference…
Very fast, visually quick to recognize differences by color.
If you have the source files, Windows file explorer shows dates/times
Search for *.ino from sketch folder:
- or - from command line
- CD to parent folder
dir *.ino /od /s /b
I have always thought the Arduino IDE should include a comment at top showing last time the sketch was edited/compiled in IDE.
omake.bat
It may be possible in old JAVA IDE to append $DATE $TIME to the sketch with a modification to the batch file. I may try, but my methodology is simply to create new directories by always doing a file-save-as and appending a trailing number to the sketch before editing. Ex: mypgm1.ino, mypgm2.ino, ..., mypgm99
omake.bat from limited documentation, appears to only be used to recompile the bootloader. Thus, another hook into the IDE would be necessary to have the OS automatically add a line to the .ino file for time/date.
You can. You can use avrdude to read back the hex file from the board (if you haven't protected it); I'm not sure if you can do it over USB, I've always used a programmer for it.
You can compare that with the hex file that is generated when you compile a sketch. It's the easiest to export your 3 sketches to binary (it's an option in the IDE menu) which will place the hex files in the directory in the sketch directories.
Unfortunately, the format of the hex files is (at least was) different (16 bytes vs 8 bytes wide). So you have to do a bit of manual hacking.
Thanks all. I do have a version number/program name that displays when I use the monitor but that is a pain, with extra coding required. (Yeah, I know 2 lines). There should be a version control in Arduino that keeps previous versions (source code) and of course, date stamps them. Autosave just saves the current version over the previous. Using SaveAs fixes that but again, a pain if you only change a few things in your code. I've used assembly compilers that had version control with setable number of versions to save, and also log file of compiles and/or uploads. This was in the day when hard drive space was at a premium!
Yep... Arduino likely should have some Metadata in a source file for automatic versioning, but there are professional tools that do such things.
Just find something that works for you, innovate or pick from a whole list of methods:
Arduino versioning with git at DuckDuckGo
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.