Hack star
Published © MIT

ESP32 Simulator - LED chaser project πŸŽ‰πŸ˜-2022

This is a platform to blink ESP32 embedded systems simulator with 10 LEDs. Use this platform to create your own beautiful projects πŸš₯πŸš₯

BeginnerProtip1 hour5,443

Things used in this project

Story

Read more

Schematics

ESP32 LED chaser project - 10 LEDs

Code

ESP32 LED chaser project code - Arduino style

Arduino
//initializing a variable for digital pin 2 to 13
int led1 = 15;
int led2 = 2;
int led3 = 4;
int led4 = 5;
int led5 = 18;
int led6 = 19;
int led7 = 21;
int led8 = 22;
int led9 = 23;
int led10 = 32;
int led11 = 33;
int led12 = 25;

void setup() {
  // put your setup code here, to run once:
 //initialize digital pin as output
 pinMode(led1, OUTPUT);
 pinMode(led2, OUTPUT);
 pinMode(led3, OUTPUT);
 pinMode(led4, OUTPUT);
 pinMode(led5, OUTPUT);
 pinMode(led6, OUTPUT);
 pinMode(led7, OUTPUT);
 pinMode(led8, OUTPUT);
 pinMode(led9, OUTPUT);
 pinMode(led10, OUTPUT);
 pinMode(led11, OUTPUT);
 pinMode(led12, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
 digitalWrite(led1, HIGH);//it mean to give 5v(high) to pins.here ,the led will be on.
 delay(30);//1000 = 1 second
 digitalWrite(led2, HIGH);
 delay(30);
 digitalWrite(led3, HIGH);
 delay(30);
  digitalWrite(led4, HIGH);
 delay(30);
  digitalWrite(led5, HIGH);
 delay(30);
  digitalWrite(led6, HIGH);
 delay(30);
  digitalWrite(led7, HIGH);
 delay(30);
  digitalWrite(led8, HIGH);
 delay(30);
  digitalWrite(led9, HIGH);
 delay(30);
  digitalWrite(led10, HIGH);
 delay(30);
   digitalWrite(led11, HIGH);
 delay(30);
   digitalWrite(led12, HIGH);
 delay(30);


 digitalWrite(led1, LOW);//it mean to give 0v(low) to pin.here, led will be off
 delay(30);
 digitalWrite(led2, LOW);
 delay(30);
 digitalWrite(led3, LOW);
 delay(30);
 digitalWrite(led4, LOW);
 delay(30);
 digitalWrite(led5, LOW);
 delay(30);
 digitalWrite(led6, LOW);
 delay(30);
 digitalWrite(led7, LOW);
 delay(30);
 digitalWrite(led8, LOW);
 delay(30);
 digitalWrite(led9, LOW);
 delay(30);
 digitalWrite(led10, LOW);
 delay(30);
 digitalWrite(led11, LOW);
 delay(30);
 digitalWrite(led12, LOW);
 delay(30);
}

Credits

Hack star

Hack star

75 projects β€’ 120 followers
an Arduino enthusiast and an electronic hobbyist

Comments