how can do i wire the power to the switches?
what is CV?
CV = configuration variable. It is a table in the decoder's permanent memory that tells it such items as volumes for various sounds (sound decoders), starting voltage, maximum voltage, momentum, 2 or 4 digit addressing, enable operation on DC, etc. Each decoder manufacturer provides a list of adjustable CVs by decoder model. By writing new values to various CVs, one can change the performance characteristics of the locomotive. The processor reads the values and computes drive for the motor or other functions accordingly.
For your wiring questions, I would strongly recommend purchasing one of the books on wiring. If using Atlas track, the Atlas book is the cheapest, and provides very simple directions using Atlas electrical components (link:
http://www.atlasrr.com/wiring.htm ). If not using Atlas components, this book would be my recommendation:
http://kalmbachcatalog.stores.yahoo.net/12207.html
Both books in their current edition talk about wiring for both DC and DCC. They will give you more information a lot faster than spending hours putting together diagrams and text from around the net. And you have the info as a permanent reference at the layout.
Assuming you have Atlas switch machines, there are 3 terminals on the machine. The center is common, and goes to the power source. The outer 2 throw the turnout one way or the other, and are hooked up to momentary switches to control the machine, one for each direction. Note that both momentary switches may be combined into a single unit such as the Atlas controller or an SPDT momentary toggle. One side of the momentary switch goes to power, and the other to the switch machine. The diagrams in the suggested books will be very helpful in understanding this paragraph.
A caution: Atlas switch machines (actually any twin coil switch machine) will cook itself if power is left on for more than a second or so. And Atlas switch controllers have a reputation for occasionally sticking in the "on" position, causing the meltdown. This is in addition to guests or children keeping the button pushed down or holding the toggle on. The safest way to preserve twin coil switch machines indefinitely is through the use of a capacitive discharge (CD) power supply. The CD unit provides a jolt of current to throw the turnout, and then limits (or turns off) the current to a safe level.
hope this helps