Here is a simple program that calls up DateTime now, prints now.day correctly and then attempts to set a volatile variable (dy) and a variable (day) to now.day and then prints the two variables. Both are printed as 10. Finally now.day is printed again for proof.
The output is
23 today's date correct.
23 Proof that now.day is not corrupted.
I hope an expert can solve this in microseconds for me.
- Code: Select all | TOGGLE FULL SIZE
volatile int dy=0;
DateTime now = RTC.now();