User manual

is output. This is done every second. Our user LED L will flash
every second as well. We monitor the function of the program to
ensure that it is still running and to see if an error occurred
in programming. However, note that the clock does not have the
precision of an actual quartz clock since the cycle and the
deviation of the micro controller quartz at 16 MHz is much higher
than in a clock quartz in the Kilohertz range (clock quartz =
32.768 kHz). Deviations of more than one minute per day are not
rare. The accuracy also strongly depends on ambience temperature.
If it fluctuates strongly over time, the clock will also have a
higher time error. We can correct the time deviation with
delay ()
.
Alternatively, we can also use
delayMicroseconds()
to correct the
deviation even better. For this, configure a digital pin as the
output and toggle it at every program run , change the condition
once at every run. This signal can be trimmed precisely to a
throughput time of 10 ms with an oscilloscope. You can determine
the deviation across an extended period by comparing the time to
a different, precise clock, e.g. a DCF-clock for a while (1 to 2
days), calculating the difference and then correcting the de-
viation with
delayMicroseconds()
.
These variables are then used to set the clock:
001 Second = 12
002 Minute = 0
003 Hour = 0
Advice
For more on the subject of clock quartz,
see: http://de.wikipedia.org/wiki/Uhrenquarz
The experiment requires the LCD basic writing that you set up
in the function test.
001 // Integrating LCD-Library
002 #include <LiquidCrystal.h>
003
004 // Specifying LCD pins
005 // RS, E, D4, D5, D6, D7
006 LiquidCrystal lcd(11, 10, 2, 3, 4, 5);
007