Description
The setup() function is used when the code starts. Use it to initialize variables, pin modes, libraries, etc.
When the Arduino board is powered up, the setup() will run once.
Example Code
int buttonPin = 3;
void setup() {
Serial.begin(9600);
pinMode(buttonPin, INPUT);
}void loop() {
// …
}



