Clocks are electrical setups that allow for the state of electrical devices to alter as the robber moves around and uses tools.
Here is an example clock: http://castledraft.com/editor/UMMwt8
The two essential components to a clock are a clock signal generator and a counter.
The clock signal generator is in the top right hand corner. It generates a single "pulse" of power each time the player moves or uses a tool and sends it to the counter.
The counter is made up of a number of "bits". Each bit works in a simple way, if it is currently "off" and receives a pulse it switches to "on", if it is "on" and receives a pulse it switches to "off" and sends a pulse to the next bit. This makes the counter count up in a binary sequence.
Counters can be built as small or as large as you desire by adding or removing bits. Also, all the electronics can easily be mirrored left to right.
If you build the above clock and try it out with a self test you will notice that indicator lights on the counter bits alternate between "on" and "off" at different rates. From right to left they will alternate every 1, 2, 4, 8 and 16 turns respectively. Note that each "turn" in electronic occurs whenever the robber moves OR uses a tool.
Using a clock
The most simple way to use a clock is to attach the counter bits states directly to traps within the house. The bits in the above example can easily be attached to devices from either the top or bottom.
In this example trapdoors are connected to bits from the bottom: http://castledraft.com/editor/c5NQgO
Each pit is attached to a different bit of the clock meaning that it will alternate between closed and open over a different number of turns. The first pit will alternate every 16 turns, the second every 8, the third every 4, the fourth every 2 and the last every turn.
You can also attach from above as in this example: http://castledraft.com/editor/qip2RC
You can also attach the final output of the timer to a bit storage unit to create constant power that only begins in 32 turns (31 moves). Here is an example - the power will switch in to the the pits and electric floors after 31 moves and stay on: http://castledraft.com/editor/EP6EYn
How Clocks Work
(unfinished) An understanding of how clock signal generators and counter bits work is not necessary in order to use clocks. Such an understanding can be useful if you wish to create advanced electronic setups with them or wish to modify them in some way. Before reading on make sure you have a grasp of how electronic cycles work.
(Content still to come...)