Updated 24 September 2020
Kits and Gadgets Electronics Inc.
Farwaniya, Kuwait 80003
Kuwait
ph: +965 99571844
kits
The following videos show various modes of activating the LEDs. Modes 2 to 6 can be achieved by simply modifying or re-arranging the program given on Mode 1.
PROGRAM:
/* Experiment No.1
By: Rolando Estomaguio - Radar Specialist - Electronics Engineer
http://www.kits-gadgets.com
Objective: To learn the operation of WeMOS NodeMCU and utilize its full functionality.
Title: Running 8 LEDs - Mode 0
Description: Turns ON & OFF 8 LED in sequence repeatedly.
*/
// The 8 LEDs are switch ON and OFF continuously with interval depending on the value of delay.
void setup() {
// initialize digital pin or GPIOs 5, 4, 0, 2, 14, 12, 13, and 15 as an output.
pinMode(05, OUTPUT);
pinMode(04, OUTPUT);
pinMode(00, OUTPUT);
pinMode(02, OUTPUT);
pinMode(14, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
pinMode(15, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(05,HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(05, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
digitalWrite(04,HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(04, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
digitalWrite(00,HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(00, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
digitalWrite(02,HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(02, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
digitalWrite(14,HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(14, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
digitalWrite(12,HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(12, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
digitalWrite(13,HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
digitalWrite(15,HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(15, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Copyright 2013 Kits and Gadgets Electronics Inc. All rights reserved.
Kits and Gadgets Electronics Inc.
Farwaniya, Kuwait 80003
Kuwait
ph: +965 99571844
kits