I am a newbie, learning C so that I can create sketches. Can anyone recommend a book (or other) that explains how Arduino sketches (in C) sets up the Arduino board.
For example, I have read the following basic command + comment:
int ledPin = 13; //which apparently sets up Arduino pin 13 to be connected to LED.(Further commands sets it as OUTPUT and then HIGH/LOW).
BUT....my limited C logic tells me that this command sets up a variable called ledPin with an initial value of 13???
Can anyone please point me in the direction of a good book that explains the logic behind skethes.
Your understanding of C is fine. The confusion is brought about by the fact that the UNO happens to have an LED on it that is arbitrarily connected to pin thirteen. There's no magic behind the scenes and if you used any other pin, you'd have to provide your own LED to light it.
It's a convenience to allow you write your first blink program without the complexity of having to connect other hardware.