loading
3Comments

Tell us about yourself!

Complete Your Profile
  • JoshK32 commented on andrea biffi's instructable simple user-adjustable DIY Nixie Clock10 months ago
    simple user-adjustable DIY Nixie Clock

    Not necessarily, all you need to do is count the overflows, and then add the maximum value to your time variable. Here's an example of what I'm talking about:int overflowCount = 0;unsigned long millisMax = 0b11111111111111111111111111111111;unsigned long prevTime = 0;void loop()unsigned long runTime = millis(); if(runTime < prevTime) { overflowCount++; //count the overflows in millis() } prevTime = millis(); unsigned long time = (runTime/1000) + ((millisMax*overflowCount)/1000); With this modification, the code should be unaffected for at least 50,000 days, or 137 years. No need to spend extra money on an RTC module or modify the PCB :)

    Not necessarily, all you need to do is count the overflows, and then add the maximum value to your time variable. Here's an example of what I'm talking about:int overflowCount = 0;unsigned long millisMax = 0b11111111111111111111111111111111;unsigned long prevTime = 0;void loop()unsigned long runTime = millis(); if(runTime < prevTime) { overflowCount++; //count the overflows in millis() } prevTime = millis(); unsigned long time = (runTime/1000) + ((millisMax*overflowCount)/1000); With this modification, the code should be unaffected for at least 50,000 days, or 137 years. No need to spend extra money on an RCT module or modify the PCB :)

    View Instructable »