Type Here to Get Search Results !

How To Use Setup And Loop Function In Arduino Programming

Setup function is the first function an Arduino program reads, and it runs only once. its all purpose is to set up the Arduino device, assigning values and properties to the board. so for example, we would like to set a specific pin number 13 to be digital OUTPUT. we will do that only one time, in the setup function. The second function, loop(), makes it possible for our sketch to run continuously and it will begin just after the last statement in the setup () function has finished executing.



when the Arduino runs a sketch, it starts at the top of the first line and than moves its way towards the bottom this is called "program flow" and refers to the order that the statements are executed one line after another looking in the simply code here, we are starting with setting the digital PIN#13 to HIGH level waiting for 1 second, that's the delay and than setting pin#13 to LOW level and than again, waiting for 1 second and loop back - start all over again.



Post a Comment

0 Comments