Using the milli() function in order to do accurate timing on the Arduino doesn’t work because it shares the same priority in code execution as any other code. I wrote a blog post that talks about using PWM and an interrupt in order to create a much more accurate clock. In my post I talk about how to wire the PWM to the interrupt and how to use the Adafruit 2.2 inch TFT LCD to display the time. The full post with pics, links and demo code is here:
I also recorded a video of it in action:
My plan here is to use the $9 Arduino Nano and the Roving Networks RN-171 serial wifi to make a wifi enabled sensor that can post to the cloud. First step i had to do was solder some legs on the smd wifi chip. These pads are small but you can see in the pictures that i have 4 legs now: tx, rx, gnd and 3.3v.
I put this new setup on a breadboard so that i could reconfigure the pins as needed. I like this sort of “dead-bug” construction.
Next up I have to communicate over serial with the part and has a lot of questions about the best way to do it. For now I am toing to use my FTDI Basic USB from sparkfun.com and teraterm at 9600 (from the user guide). Ill let you know how it goes.
Also me demo’ing on the Adafruit.com “Show & Tell” with Amanda and Limor from Adafruit:
I start at the halfway point on the video