Shoot the electrical box, and after a moment, a Lightning Rod will fall onto the ground--pick it up. With all three Lightning Rods collected, return to the Courtyard and head onto the castle wall.