What is Ladder logic???

The PLC design method often starts with an electrical circuit, or block diagram, which is then redrawn as a ladder diagram, and then converted into an Arduino sketch before being compiled and downloaded in the normal way. The figure below illustrates the process
The name 'ladder diagram' comes from the superficial resemblance to a physical ladder, with vertical power rails at each side, and horizontal circuit branches called rungs connected between the rails. More complex ladder diagrams have a series of rungs, each of which represents a separate circuit.
Ladder diagrams are an adaptation of an earlier technology called relay logic, in which switches and relays are used to control industrial circuits. A simple relay logic circuit is shown below.
Notice the positive power rail at the left, and negative at the right. Switches SW1 and SW2 are push-to-make and push-to-break types, causing their associated lamps to be lit when the switches are pressed or released, respectively. Switch SW3 is connected to relay coil RL1 and the changeover relay contacts are then linked to lamps BL3 and BL4. The relay contacts are arranged so that only one lamp is lit at any time.