Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    This is weird. Sending data to a disconnected serial port shouldn't slow things down, the data just gets sent to nowhere. I'm not sure what if (Serial) exactly does on that board, but have you tried just removing that test? Commented Aug 23, 2023 at 14:54
  • 1
    You have something weird going on with the }; before StatusOn(); and the lack of { after if (displayTime()). I'm guessing it's just from editing, but it's something you may want to fix in the question. Commented Aug 23, 2023 at 14:55
  • @timemage I fixed the formating for better readability, but the code was correct. The syntax is if (condition) command; where command may be compound command, like { ... } or simple command, or another if (condition) command; block as it was here. You are right, that the formating was remainder from earlier changes. Commented Aug 23, 2023 at 19:19
  • @PMF I had it first totally without the if (Serial), in hope that the output will just 'go nowhere' eventually and all will work the same. But I had seen the ?timeouts?, which behaved the same as is described in Problem section, so I tried the if (Serial) construction recomended somewhere, but it did not work. I also tried other conditions as in Difference from other section, but the problem remains. Commented Aug 23, 2023 at 19:27
  • @gilhad it's mostly the semicolon that throws things. You can put a semicolon after code block like that, but it's not terminating it. it's actually it's own statement called a "null statement". you use them in places to fulfill a syntax requirement. but, when you put it there, without a requirement, it just makes it look like you intended to do something else. if you really want to throw people put a number in front of it like if (condition) {} 7; it'll still be "correct", but it will look even less so than what you have. =) Commented Aug 24, 2023 at 15:44