Basic Arduino Light System (LED ON/OFF)

Components:

  1. Arduino Uno
  2. LED
  3. 220Ω resistor
  4. Breadboard + wires

Connection:

  • LED + leg → Pin 8
  • LED - leg → GND (through 220Ω resistor)

Code:

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



 

Comments

Popular posts from this blog

Arduino Uno Connection Test – How to Verify Your Board is Working

Arduino LED Blink Tutorial – How to Blink an LED Using Digital Pin 2