How setup() is different from loop()?
Question :
How setup() is different from loop()?
setup() is called once in the program when a sketch starts after power-up. It is used to initialize variables, input and output pin modes, and other libraries needed in the sketch.
loop() is used after setup() been called, function loop() is executed repeatedly in the main program. It controls the board until the board is powered off or is reset.