Serial Monitor Wont Display LOOP Statements

I wrote a working program a few years back and it runs a nixie clock I built just fine (DS clock module and Mega 2560). I built another clock exactly like the one before. New clock module and Mega 2560. I am now running the latest Arduino ISE 2.3.8.

I uploaded the EXACT same program it and compiles just fine BUT… it will not show any troubleshooting “print statements” in the serial monitor so I can troubleshoot any wiring or set the clock module, etc. correctly. Here’s what I know / tried:

I know how to open the monitor from the drop down menu and/or the magnifying glass. Serial monitor opens, blank response.

Baud in the program and monitor are both set to 9600.

Verified Mega works with the examples of “blink” and a test program I wrote to drive the Nixie tubes. My wiring is correct for the tubes. All Outputs turn on and drive the tubes correctly. I cannot test if the clock module is working because I cannot access the serial monitor. So I test if there is a usb cable issue, etc. …

Simple example programs where I put the print lines in the SET UP area and a different text line in the LOOP area both print so I can see the simple program runs the monitor in both setup and loop.

I Looked to see if any of my printlines are commented out in the loop area and found none. If I can get the lines to print out while the loop is running, then I can finish calibration.

By watching my nixie tubes they are only showing 0000 so I am wondering if the loop is even running or stuck. If I simplify the program I can get the tubes to behave perfectly. This is baffling me because I know this program runs in an older clock. Is my loop stuck somewhere esecially BEFORE the first printlines are encoutered? Thanks in advance.

GJS

Russian_Nixie_Clock_26032026V0.ino (37.5 KB)

As per the pinned post re 'How to get the most from the forum', please use Tools / Auto Format on your code, then Edit / Copy for Forum Markdown and paste it in a reply to this. Next, hand-draw a wiring diagram, take a photo and post it as well.

I can not see the reason why loop () would not Serial.print at first glance at your code.

When something like this happens to me I usually start commenting out different parts of the code to find where the bug is (in most of the cases it is the bug :/).

try this: comment out everything in setup() except for prints and serial initialization.

if you see debug prints in your monitor after that - that means your initialization somehow breaks Serial

void setup(void) {
  Serial.begin(9600);
  delay(1000);
  Serial.println(".................");
  Serial.print("THIS LINE PRINTS FROM SETUP");
  Serial.println(".................");
}

void setup(void) {
  Serial.begin(9600);
  delay(1000);
  Serial.println(".................");
  Serial.print("THIS LINE PRINTS FROM SETUP");
  Serial.println(".................");
}

void loop(){}

As @sonofcy already asked you, please INDENT your code correctly, because the way you posted it is difficult to read: just press Ctrl-T in the IDE and it will format it for you.

And please AVOID attaching the code, but instead insert it into the text using the "CODE" button to mark it and make it readable even without downloading the file. This will make it easier for us to help you (and you'll have more people willing to do so).

So after reformatting the code, EDIT your first post, remove the attachment, and insert it into the text using the "CODE" button to mark it and make it readable even without downloading the file. Thank you.

It may be the case that on the board you are using, data sent to the serial gets cached and needs to be flushed.

  Serial.println(".................");
  Serial.print("THIS LINE PRINTS FROM SETUP");
  Serial.println(".................");
  Serial.flush();

It looks like you have an outdated DS3231 library from Rinky-Dink... probably scraped from here... DS3231 - Rinky-Dink Electronics because your sketch uses macros that are inside the .h file (namely, THURSDAY) as well as creating the Time t class:

class Time
{
public:
	uint8_t		hour;
	uint8_t		min;
	uint8_t		sec;
	uint8_t		date;
	uint8_t		mon;
	uint16_t	year;
	uint8_t		dow;

	Time();
};

Bottom line... you need to install Rinky-Dink's library. Link shown above.

For a "safer" reference, ElectroNoobs uses the Rinky-Dink library here... apparently to make an electric scooter...