File tree Expand file tree Collapse file tree 5 files changed +85
-0
lines changed Expand file tree Collapse file tree 5 files changed +85
-0
lines changed Original file line number Diff line number Diff line change 1+ # ESP8266 NodeMCU sample code
2+
3+ ## Install
4+
5+ ### CP210x drivers
6+
7+ Follow instructions at https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers
8+
9+ ### Arduino IDE
10+
11+ Follow instructions at https://www.arduino.cc/en/Main/Software
12+
13+ ## Setup
14+
15+ Follow instructions at https://arduino-esp8266.readthedocs.io/en/latest/installing.html
16+
17+ With NodeMCU board, set Upload speed to 9600.
18+
19+
20+ ## Upload code
21+
22+ Plug in, upload code & enjoy!
Original file line number Diff line number Diff line change 1+ void setup () {
2+ pinMode (0 , OUTPUT);
3+ }
4+
5+ void loop () {
6+ digitalWrite (0 , HIGH);
7+ delay (500 );
8+ digitalWrite (0 , LOW);
9+ delay (500 );
10+ }
Original file line number Diff line number Diff line change 1+ void setup () {
2+ Serial.begin (9600 );
3+ pinMode (D1, OUTPUT);
4+ pinMode (D3, OUTPUT);
5+ pinMode (D5, OUTPUT);
6+ pinMode (D7, OUTPUT);
7+ }
8+
9+ void loop () {
10+ digitalWrite (D1, HIGH);
11+ delay (1000 );
12+ digitalWrite (D1, LOW);
13+ delay (1000 );
14+
15+ digitalWrite (D3, HIGH);
16+ delay (1000 );
17+ digitalWrite (D3, LOW);
18+ delay (1000 );
19+
20+ digitalWrite (D5, HIGH);
21+ delay (1000 );
22+ digitalWrite (D5, LOW);
23+ delay (1000 );
24+
25+ digitalWrite (D7, HIGH);
26+ delay (1000 );
27+ digitalWrite (D7, LOW);
28+ delay (1000 );
29+ }
Original file line number Diff line number Diff line change 1+ #include < ESP8266WiFi.h>
2+
3+ void setup ()
4+ {
5+ Serial.begin (9600 );
6+ Serial.println ();
7+ Serial.setDebugOutput (true );
8+
9+ WiFi.begin (" ssid" , " password" );
10+
11+ Serial.print (" Connecting" );
12+ while (WiFi.status () != WL_CONNECTED)
13+ {
14+ delay (500 );
15+ Serial.print (" ." );
16+ }
17+ Serial.println ();
18+
19+ Serial.print (" Connected, IP address: " );
20+ Serial.println (WiFi.localIP ());
21+ }
22+
23+ void loop () {}
Original file line number Diff line number Diff line change 1+ For information on installing libraries, see: http://www.arduino.cc/en/Guide/Libraries
You can’t perform that action at this time.
0 commit comments