UPGRADED bare_minimum.ino sketch

PUNKTYs_IMPROVED_BARE_MINIMUM
UPGRADED bare_minimum.ino sketch, to encorporate the addition of a SERIAL MONITOR println showing existing sketch details

UP UNTIL NOW, there has not been any publicised(that I could find, anyways…)- way of actually TRACKING/RETRIEVING any information whatsoever BACK from your arduino boards regarding the sketch that you have already GOT loaded ONTO it…
Now, I own a number of boards, some of which are duplicates, so keeping a track of which board had which sketch uploaded onto it at any one time began to be a pain in the ass…
SO, I have provided here my solution TO this issue;
A very clean, very simple
#define
statement, trailed by a corresponding
Serial.println()
RETRIEVAL of that #define statements’ value (ie the data you have provided for yourself WITHIN that #define, as well as the sketches’ FILENAME/DATESTAMP, also…
Hope it helps someone, anyway…

here’s the link (have cut/copied the code directly underneath, too…);

https://create.arduino.cc/editor/Punkty24/2510dfc3-3ecd-4924-83b6-efc22792d391/preview

/*

//PUNKTYs’ UPGRADED AND IMPROVED //

//BARE MINIMUM.ino SKETCH //

This #define SKETCH_VERSION " ";
, & accompanying
Serial.println(F("START " FILE "\r\nVersion " SKETCH_VERSION " from " DATE));
in setup returns
<VERSION #>
&
, as well as

*/

#define SKETCH_VERSION “1.1 ADDED V# & FILENAME/DATE”

void setup() {

/*The following returns:
<VERSION #>
&
, as well as

*/
Serial.begin(9600);
Serial.println(F("START " FILE "\r\nVersion " SKETCH_VERSION " from " DATE));

}

void loop() {
// put your main code here, to run repeatedly:

}

(deleted)

spycatcher2k:
Or , use a peice of white tape, and a dry marker pen. Or, upload an empty sketch when the boards are not boing used.

lol

fair point, however when you have an unruly or just plain RAGE-INDUCINGLY-FRUSTRATING work-in-progress sketch, possibly bridged over multiple identical boards, it's helpful to get a reminder of which VERSION of said sketch is on there....

plus im lazy and this enables that....

That's swell, may serve your particular interests and applications well, and illustrates some useful features of the tool chain, but it's pretty far from either "bare" or "minimum" by most measures...

For someone learning it can be very useful to know what really is the bare minimum - i.e. nothing in the program that is not absolutely essential.

I don't consider myself a beginner but there is a huge amount of stuff I know nothing about and most times when I start to explore something new the introductory programs have huge amounts of extras that make it very difficult to understand what is really necessary. And I find it much easier to understand something and build my knowledge when I can see the minimum.

Of course things will be different for someone who just wants a solution and is not concerned with understanding how it works.

And for many of my own programs I do include code that does a similar job to what @Punkty24 is suggesting - it can be very useful.

...R