تشغيل LED على شكل مستوى متقدم ▐ LED Chaser with Nodemcu ESP8266 Basic to Advanced level - DIY Channel3

DIY Channel3

Arduino│ESP8266│ESP32│Drone│Robot

تشغيل LED على شكل مستوى متقدم ▐ LED Chaser with Nodemcu ESP8266 Basic to Advanced level

مشاركة هذا

 




- المكونات الاساسية :

- esp8266 nodemcu
-   LED 5MM

- Breadboard 
- Jumper wires

-  مخطط الرسم البياني :


- كود أردوينو :


// Led Chaser with NodeMCU(ESP8266) Basic to Advance level
// By : DIY Channel
// My YouTube Channel : https://www.youtube.com/c/DIYChannel2019

#define led_one  12
#define led_two 14
#define led_three 2
int Delay = 300;


void setup() {
  pinMode(led_one, OUTPUT);
  pinMode(led_two, OUTPUT);
  pinMode(led_three, OUTPUT);
  // put your setup code here, to run once:

}

void loop() {

  LedChaser(1,0,0);
  delay(Delay);
  LedChaser(0,1,0);
  delay(Delay);
  LedChaser(0,0,1);
  delay(Delay);


 
  
  // put your main code here, to run repeatedly:

}

void LedChaser(int i, int j, int k)
{
  digitalWrite(led_one, i);
  digitalWrite(led_two, j);
  digitalWrite(led_three, k);
}

DIY Channel







No comments:

Post a Comment