0

I have the following Ardruino CPP code. This code works fine:

while (rtc.now().second() != 0) delay(50);
curDateTime = rtc.now();

I wanted to move the assignment into the loop so that I'm capturing the time I'm actually testing. I thought I could assess the result of the assignment as shown below, but while the following compiles, it apparently throws an exception.

while ((curDateTime = rtc.now()).second() != 0) delay(50);

I'm using the first example, so it is working, but I really would like to understand what I did wrong with the second example.

I kept the example super short in the hope that my error would be obviously and easy to explain. If not, I will just dig in a little more on my side.

Many Thanks!!

Gronk
  • 149
  • 2
  • 9

0 Answers0