We were there in May, asked the kind volunteers at the port the best way into town and were told to take the number 11 bus, they accepts credit cards.
Make sure you walk through the group selling the HOHO bus tours, the stop is on the other side of the road just left from the zebra crossing. The stop you need is Princes Street near the Scots monument, you can see the castle from there its a nice uphill.
Have a nice day the Royal Mile is amazing.
Happy planning
Rosalyn