Building a Standalone Temperature Logger: Part 8
Posted in Projects on Feb 20th, 2011
Welcome to Part 8, before we get starting with making the PCB I thought I’d review my code/hardware plus add some more functionality to our project.
We don’t need a Watchdog f_wdt variable
On review of my code and the example watchdog code I used, I found that the watchdog f_wdt variable wasn’t adding any value to our code. I came to this conclusion because when you run the system_sleep() function and it reaches sleep_mode(); it sleeps there. When the Watchdog timer wakes it up, it heads to the watchdog vector (ISR(WDT_vect)) and now since it’s awake again it continues to run next bit of code.
// This will work because we are initialising the watchdog vector and // once the watchdog times out, it will wake up, go here, // do nothing and continue our code ISR(WDT_vect) { }
Now I’ve give you an example of where we might need the f_wdt variable.