You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/tutorials/blink.rst
+15-13
Original file line number
Diff line number
Diff line change
@@ -7,27 +7,27 @@ Introduction
7
7
8
8
This is the interactive blink tutorial using `Wokwi`_. For this tutorial, you don't need the ESP32 board or the Arduino toolchain.
9
9
10
-
.. note:: If you don't want to use this tutorial with the simulation, you can copy and paste the :ref:`blink_example_code` from `Wokwi`_ editor and use on the Arduino IDE or PlatformIO.
10
+
.. note:: If you don't want to use this tutorial with the simulation, you can copy and paste the :ref:`blink_example_code` from `Wokwi`_ editor and use it on the `Arduino IDE`_ or `PlatformIO`_.
11
11
12
12
About this Tutorial
13
13
-------------------
14
14
15
-
This tutorial is the most basic for any getting started. In this tutorial, we will show how to set a GPIO pin as output to drive a LED to blink each 1 second.
15
+
This tutorial is the most basic for any get started. In this tutorial, we will show how to set a GPIO pin as an output to drive a LED to blink each 1 second.
16
16
17
17
Step by step
18
18
------------
19
19
20
20
In order to make this simple blink tutorial, you'll need to do the following steps.
21
21
22
-
1. Define the GPIO for the LED.
22
+
1. **Define the GPIO for the LED.**
23
23
24
24
.. code-block::
25
25
26
26
#define LED 2
27
27
28
28
This ``#define LED 2`` will be used to set the GPIO2 as the ``LED`` output pin.
29
29
30
-
2. Setup.
30
+
2. **Setup.**
31
31
32
32
Inside the ``setup()`` function, we need to add all things we want to run once during the startup.
33
33
Here we'll add the ``pinMode`` function to set the pin as output.
@@ -38,9 +38,9 @@ Here we'll add the ``pinMode`` function to set the pin as output.
38
38
pinMode(LED, OUTPUT);
39
39
}
40
40
41
-
The first argument is the GPIO number, already defined and the second is the mode, here defined as output.
41
+
The first argument is the GPIO number, already defined and the second is the mode, here defined as an output.
42
42
43
-
3. Main Loop.
43
+
3. **Main Loop.**
44
44
45
45
After the ``setup``, the code runs the ``loop`` function infinitely. Here we will handle the GPIO in order to get the LED blinking.
46
46
@@ -56,28 +56,28 @@ After the ``setup``, the code runs the ``loop`` function infinitely. Here we wil
56
56
The first function is the ``digitalWrite()`` with two arguments:
57
57
58
58
* GPIO: Set the GPIO pin. Here defined by our ``LED`` connected to the GPIO2.
59
-
* State: Set the GPIO state as HIGH (on) or LOW (off).
59
+
* State: Set the GPIO state as HIGH (ON) or LOW (OFF).
60
60
61
-
This first ``digitalWrite`` we will set the LED on.
61
+
This first ``digitalWrite`` we will set the LED ON.
62
62
63
63
After the ``digitalWrite``, we will set a ``delay`` function in order to wait for some time, defined in milliseconds.
64
64
65
65
Now we can set the GPIO to ``LOW`` to turn the LED off and ``delay`` for more few milliseconds to get the LED blinking.
66
66
67
-
4. Run the code.
67
+
4. **Run the code.**
68
68
69
-
To run this code, you'll need a development board and the Arduino toolchain installed in your computer. If you don't have both, you can use the simulator to test and edit the code.
69
+
To run this code, you'll need a development board and the Arduino toolchain installed on your computer. If you don't have both, you can use the simulator to test and edit the code.
70
70
71
71
Simulation
72
72
----------
73
73
74
-
This simulator is provided by `Wokwi`_ and you can test the blink code and play with some modification to learn mode about this example.
74
+
This simulator is provided by `Wokwi`_ and you can test the blink code and play with some modifications to learn more about this example.
0 commit comments