SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By messar
#200705
I am working with a nRF52832 breakout board, and trying to use mills() to time a 30 minute event. Surprisingly, I looks like I'm running into some type of rollover at 512 seconds.

The following code:
Code: Select all
#include <Wire.h>
void setup()
{
Serial.begin(9600);
Wire.begin();
}
void loop() 
{ 
  Serial.println(millis())
}
GIves this every time I run. (abbreviated)
Code: Select all
511974
511983
511991
511999
8
11
15
19
23
Any help would be appreciated on what needs to change to avoid this.
Thanks,

matt
By messar
#200714
Hi,
Thanks for catching the error - missing a ;

Here is the corrected code:
Code: Select all
#include <Wire.h>
void setup()
{
Serial.begin(9600);
Wire.begin();
}
void loop() 
{ 
  Serial.println(millis());
}