Introduction to Arduino
Let’s start by understanding what Arduino is and what it can do for you as a beginner in electronics.

Installing the Arduino IDE
Before you can start programming Arduino, you need to install the Arduino IDE — the official development environment.

Blink: Your First Arduino Project
Let's build your first real Arduino project — make an LED blink!

Understanding Arduino Code Structure
Learn how Arduino code is structured and how setup() and loop() work together.

Working with Digital Output
Learn how to control components like LEDs, buzzers, and relays using digital pins.

Working with Digital Input
Learn how to use buttons and switches with Arduino and respond to user input.

Working with Analog Input
Learn how to read variable values from sensors using analog pins.

Working with Analog Output (PWM)
Use analogWrite() to control brightness, speed, and more with Pulse Width Modulation.

Final Assessment & Certificate
Take this final quiz to test your knowledge. Score 71% or more to earn your certificate!

Controlling Two LEDs with Digital Pins
Об уроке

Let’s take it one step further: control two LEDs using two different digital output pins.

 

🧰 What you need:
– 2x LEDs
– 2x 220Ω resistors
– Jumper wires
– Arduino board
– Breadboard (optional)

 

⚙️ Wiring:
– First LED: Connect anode (+) to **pin 2**, cathode (–) through resistor to **GND**
– Second LED: Connect anode (+) to **pin 3**, cathode (–) through resistor to **GND**

 

💻 Code Example:

void setup() {
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
}

void loop() {
digitalWrite(2, HIGH); // LED 1 ON
digitalWrite(3, LOW); // LED 2 OFF
delay(500);

digitalWrite(2, LOW); // LED 1 OFF
digitalWrite(3, HIGH); // LED 2 ON
delay(500);
}

This will alternate the LEDs — one turns on while the other turns off.

💡 Try playing with different timing or add more LEDs using pins 4, 5, etc.

Выберите поля, которые будут показаны. Остальные будут скрыты. Перетащите их, чтобы изменить порядок.
  • Изображение
  • SKU
  • Рейтинг
  • Цена
  • Акции
  • Доступность
  • Добавить в корзину
  • Описание
  • Содержание
  • Вес
  • Размеры
  • Дополнительная информация
Щелкните снаружи, чтобы скрыть панель сравнения
Сравнить