Doing an Arduino project involves both hardware and software setup. Part of the project will involve setting up a circuit, or a complete path for electrons to flow. The other part will invlove writing a program to control the various components in your project.
This section of the program only runs once when the program begins. You normally use pinMode() in this section to setup which pins are going to be used later in the program and whether they are going to be used as OUTPUT or INPUT
Void Loop
This section of the program continue to loop as long as the program is running. The main part of your code will be placed in this section.
Void Setup
Sets pin 8 as OUTPUT
Void Loop
Turns LED ON and OFF
pinMode()
This functions sets a particular pin to act as either an INPUT or OUTPUT.
o An INPUT takes in or recieves information
o An OUTPUT give out power to the components in the circuit
OUTPUT
Needs power to turn on
INPUT
Takes in button state (pressed/not pressed)
digitalWrite()
This function allows you to send voltage (HIGH) or stop voltage (LOW) through the circuit.
HIGH
LED Turns on
LOW
LED Turns off
delay()
This function allows you to add small "pauses" in your program in between lines of code. The time for the delay needs to be given in milliseconds and placed inside the parenthesis.