Edinburgh Castle is accessed at the top of the Royal Mile, via the Esplanade, which was built in the 18th and 19th centuries as a parade ground. You enter the Castle across a drawbridge, the last ever to be built in Scotland. Even if you do not want to enter the castle itself, the views from the Esplanade of Edinburgh are excellent.

