From 3c04ab07f66f279b0a346b91c6b4a131acb1d156 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 14 Jun 2018 11:57:29 +0200 Subject: wip --- assignments/blink-a-led/blink-a-led.md | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'assignments/blink-a-led/blink-a-led.md') diff --git a/assignments/blink-a-led/blink-a-led.md b/assignments/blink-a-led/blink-a-led.md index a08bc4e..72bbb9c 100644 --- a/assignments/blink-a-led/blink-a-led.md +++ b/assignments/blink-a-led/blink-a-led.md @@ -6,10 +6,19 @@ Check that your local environment is working properly. ## Configure the Arduino IDE -Under *Tools* -> *Board* make sure that "NodeMCU 1.0 (ESP-12E Module)" -is available and selected. +1. Make sure the "ESP8266" core is installed. If it is not installed + follow the installation instructions: -Create a new sketch with *File* -> *New* and compile it with *ctrl-R*. + [https://github.com/esp8266/Arduino#installing-with-boards-manager](https://github.com/esp8266/Arduino#installing-with-boards-manager) + +1. Under *Tools* -> *Board* make sure that "NodeMCU 1.0 (ESP-12E + Module)" is available and selected. + +1. Select the correct serial port: *Tools -> Port*. + +1. Select the highest upload speed: *Tools -> Upload Speed*. + +1. Create a new sketch with *File* -> *New* and compile it with *ctrl-R*. ## Step 1 @@ -24,7 +33,7 @@ orientation is not important, but the LED's orientation is important. ## Step 2 -Implement `setup()` and `loop()`. In `setup()` configure the LED pin and blink the LED in `loop()`. +Implement `setup()` and `loop()`: In `setup()` configure the LED pin and blink the LED in `loop()`. Use these functions: @@ -32,9 +41,14 @@ Use these functions: Serial.begin(115200); Serial.println(string); +// Pin is D1/D2/D.. +// mode is INPUT or OUTPUT pinMode(pin, mode); -digitalWrite(pin, state); // HIGH or LOW -delay(); + +// HIGH or LOW +digitalWrite(pin, state); + +delay(ms); ~~~ ## Tips -- cgit v1.2.3