Tag

arduino

Browsing

The quick answer to “How do you reset millis()” is:  You Don’t!  And here’s why:  if you did, it would potentially break most libraries and functions that rely on it.  Generally the reason people want to reset it, is that they are concerned about rollover.  Instead of focusing on resetting millis(), here is how to use it correctly.

Need to brush up on how millis() works?  I’ve got a tutorial on how to effectively multi-task with millis() and another line-by-line tutorial on blink Without delay

Avoiding rollover and checking how much time as passed is done in a single line:

if ((unsigned long)(millis() - previousMillis) >= interval)

That single line of code is all that is really needed, to avoid rollover!  Pretty simple, huh?  So let’s go into more detail about how this works and what each of those variables does.

Accurate RTC Shield with Kapton Stencil

For the past couple of weeks I have been working with the DS3231 Maxim. This chip is a I2C based RTC with an integrated temperature compensated oscillator and crystal.This means despite changing temperature conditions, it will maintain a very accurate track of time. If you’re interested in the first rev of the PCB, let me know. I have a few available. They are functional, however, the prototyping area came bad.I have a set of new ones with a proper prototyping area, reset button, and power LED in process.

Check out more on the  Accurate RTC Shield Project Page

There are many options for powering an Arduino board.  The designers did a great job of designing an auto-select circuit that makes it simple to power the boards.  However, there are trade offs in how much power is available and how much power gets wasted.  Australian Robotoics has a great breakdown of what an Arduino looks like under a thermal camera, when powered from USB and various external sources.  I don’t agree with everything that is said in this article, but the pictures are very revealing (and cool to look at).

Fuelling Your Arduino – Why you should use an External Power Breakout | Australian Robotics.

Several months ago I started a project to build a Binary Clock, using a Laser Cut enclosure.  The plan was to use Ponoko’s laser cutting service.  Looking through the materials available, I decided to use Bamboo.  Knowing I was going to build a Bamboo enclosure for a Binary clock, helped me come to the name BinBoo.  Even though I call it a Binary Clock, it is actually a BCD clock

There are still a few issues to work out, but I am very happy with v1.