burcakcubukcu
Published © GPL3+

8 LED Sweep

This was my first project with Arduino Uno. I started with simple one LED blink code. It's easy to understand. Code repeats itself.

BeginnerProtip2,441
8 LED Sweep

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
LED (generic)
LED (generic)
×8
Resistor 330 ohm
Resistor 330 ohm
×1
Jumper wires (generic)
Jumper wires (generic)
×25

Software apps and online services

Arduino Web Editor
Arduino Web Editor

Story

Read more

Schematics

8 Led Sweep With Ledblink

Code

8 Led Sweep With Ledblink

Arduino
8 LEd Sweep left to right than back
int ledPin = 13;
int ledPin1 = 12;
int ledPin2 = 11;
int ledPin3 = 10;
int ledPin4 = 9;
int ledPin5 = 8;
int ledPin6 = 7;
int ledPin7 = 6;
/*

*/

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);
  pinMode(ledPin4, OUTPUT);
  pinMode(ledPin5, OUTPUT);
  pinMode(ledPin6, OUTPUT);
  pinMode(ledPin7, OUTPUT);
}

void loop() {
  digitalWrite(ledPin, HIGH);
  delay(50);
  digitalWrite(ledPin, LOW);
  delay(50);
  digitalWrite(ledPin1, HIGH);
  delay(50);
  digitalWrite(ledPin1, LOW);
  delay(50);
  digitalWrite(ledPin2, HIGH);
  delay(50);
  digitalWrite(ledPin2, LOW);
  delay(50);
  digitalWrite(ledPin3, HIGH);
  delay(50);
  digitalWrite(ledPin3, LOW);
  delay(50);
  digitalWrite(ledPin4, HIGH);
  delay(50);
  digitalWrite(ledPin4, LOW);
  delay(50);
  digitalWrite(ledPin5, HIGH);
  delay(50);
  digitalWrite(ledPin5, LOW);
  delay(50);
  digitalWrite(ledPin6, HIGH);
  delay(50);
  digitalWrite(ledPin6, LOW);
  delay(50);
  digitalWrite(ledPin7, HIGH);
  delay(50);
  digitalWrite(ledPin7, LOW);
  delay(50);
  digitalWrite(ledPin7, HIGH);
  delay(50);
  digitalWrite(ledPin7, LOW);
  delay(50);
  digitalWrite(ledPin6, HIGH);
  delay(50);
  digitalWrite(ledPin6, LOW);
  delay(50);
  digitalWrite(ledPin5, HIGH);
  delay(50);
  digitalWrite(ledPin5, LOW);
  delay(50);
  digitalWrite(ledPin4, HIGH);
  delay(50);
  digitalWrite(ledPin4, LOW);
  delay(50);
  digitalWrite(ledPin3, HIGH);
  delay(50);
  digitalWrite(ledPin3, LOW);
  delay(50);
  digitalWrite(ledPin2, HIGH);
  delay(50);
  digitalWrite(ledPin2, LOW);
  delay(50);
  digitalWrite(ledPin1, HIGH);
  delay(50);
  digitalWrite(ledPin1, LOW);
  delay(50);
  digitalWrite(ledPin, HIGH);
  delay(50);
  digitalWrite(ledPin, LOW);
  delay(50);
  
}

Credits

burcakcubukcu

burcakcubukcu

1 project • 1 follower

Comments