Guided combustion with Arduino

tarafından
21352
Guided combustion with Arduino

The most important application of the Arduino training is the guided firing process. If you understand the LED burning process, you are halfway through.
The electronic materials we need to light an LED with Arduino are Each of the red, green and blue LEDs, each of the 220,330,470 ohm resistors, male jumper cables so we can attach the pins to the breadboard and the Arduino board to our breadboard. After we have installed our circuit, we open the Arduino IDE program and enter the following codes:



int led = 8;            
void setup() {
  pinMode(led, OUTPUT);
}
void loop() {
  digitalWrite(led, HIGH);
  delay(1000);
  digitalWrite(led, LOW);
  delay(1000);
}

To identify each line of code:

The text between lines 1 and 4 shows who wrote the codes / * – * /. Since this text is between / * – * /, it has no code value. If you also add “// Description” after each line, the program will not perceive this text as a code value thanks to the // tag.
In line 5, we defined an integer value and assigned a number to it, so how do we write this number? Our integer number that we wrote in the program is the pin number on our Arduino board. We tell the program that we want to write our LED using the 8th pin.
6-8. We write whether the circuit elements we will use between the lines are output or input. Since our LEDs are output, we write like the figure in the 7th line.
9-14 and tell this platform what we want to do with the codes between the lines. Any code between the void-loop commands goes into an infinite loop here.
10ve11. In the line we say that we want to light our LED for 1000 milliseconds (1 second).
12ve13. We tell our lines not to stay on the same guide for 1 second.