delay(1000); // wait for a second.
digitalWrite(ledPin, LOW); // set the LED off.
delay(1000); // wait for a second
}
Single line comments start with
Code Explanation:
of that line is considered a comment.
Comments are a great way to leave notes in your code explaining
why you wrote it the way you did.
The first line of code is:
int ledPin = 10; // define digital pin 10
As the comment above it explains, this is giving a name to the pin that
the LED is connected to. You can change the connection pin here.
Next, we have the "setup" and "loop" function
void setup()
Every Arduino sketch must have a 'setup' function, and the place where
you might want to add instructions of your own is between the { and
the }.
In this case, there is just one command there, which, as the comment
//
and everything up until the end
24