- المكونات الاساسية :
- esp8266 nodemcu
- LED 5MM- مخطط الرسم البياني :
- كود أردوينو :
// 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