|
/*
NodMCU的例子程序,測(cè)試輸出口,接LED可閃爍。
ESP8266核心
*/
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(D0, OUTPUT); //USER
pinMode(D1, OUTPUT);
pinMode(D2, OUTPUT);
pinMode(D3, OUTPUT); //FLASH
pinMode(D4, OUTPUT); //TXD1,BlueLED
pinMode(D5, OUTPUT);
pinMode(D6, OUTPUT);
pinMode(D7, OUTPUT); //RXD2
pinMode(D8, OUTPUT); //TXD2
pinMode(D9, OUTPUT); //RXD0
pinMode(D10, OUTPUT); //TXD0
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(D0, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(D0, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
digitalWrite(D1, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(D1, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
digitalWrite(D2, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(D2, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
digitalWrite(D3, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(D3, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
digitalWrite(D4, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(D4, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
digitalWrite(D5, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(D5, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
digitalWrite(D6, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(D6, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
digitalWrite(D7, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(D7, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
digitalWrite(D8, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(D8, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
digitalWrite(D9, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(D9, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
digitalWrite(D10, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(D10, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
}
|
評(píng)分
-
查看全部評(píng)分
|