-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathled_example.html
238 lines (209 loc) · 13.3 KB
/
led_example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LED Example - ESP32 - — ESPP main documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/copybutton.css" type="text/css" />
<link rel="stylesheet" href="_static/theme_overrides.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/clipboard.min.js"></script>
<script src="_static/copybutton.js"></script>
<script src="_static/js/theme.js"></script>
<script type="text/javascript">
DOCUMENTATION_OPTIONS.PAGENAME = 'led_example';
DOCUMENTATION_OPTIONS.PROJECT_SLUG = 'esp-cpp';
DOCUMENTATION_OPTIONS.LATEST_BRANCH_NAME = 'master';
DOCUMENTATION_OPTIONS.VERSIONS_URL = 'https://dl.espressif.com/dl/esp-idf/idf_versions.js';
DOCUMENTATION_OPTIONS.LANGUAGES = ["en"];
DOCUMENTATION_OPTIONS.IDF_TARGET = 'esp32';
DOCUMENTATION_OPTIONS.HAS_IDF_TARGETS = ["esp32", "esp32s2", "esp32c3"]
DOCUMENTATION_OPTIONS.RELEASE = 'main';
</script>
<script type="text/javascript" src="https://dl.espressif.com/dl/esp-idf/idf_versions.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="LED Strip APIs" href="led_strip.html" />
<link rel="prev" title="LED APIs" href="led.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> ESPP
<img src="_static/espressif-logo.svg" class="logo" alt="Logo"/>
</a>
<div class="selectors">
<select id="target-select" style="width: 150px;" hidden>
<option value="" disabled selected>Choose target...</option>
</select>
</div>
<div class="selectors">
<select id="version-select" style="width: 150px;" hidden>
<option value="" disabled selected>Choose version...</option>
</select>
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="adc/index.html">ADC APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="base_component.html">Base Compoenent</a></li>
<li class="toctree-l1"><a class="reference internal" href="base_peripheral.html">Base Peripheral</a></li>
<li class="toctree-l1"><a class="reference internal" href="battery/index.html">Battery APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="bldc/index.html">BLDC APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="ble/index.html">BLE APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="button.html">Button APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="controller.html">Controller APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="cli.html">Command Line Interface (CLI) APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="color.html">Color APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="csv.html">CSV APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="display/index.html">Display APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoder/index.html">Encoder APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="esp32_timer_cam.html">ESP32 TimerCam</a></li>
<li class="toctree-l1"><a class="reference internal" href="esp_box.html">ESP BOX</a></li>
<li class="toctree-l1"><a class="reference internal" href="event_manager.html">Event Manager APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="file_system.html">File System APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="filters/index.html">Filter APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="ftp/index.html">FTP APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="haptics/index.html">Haptics APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="hid/index.html">HID APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="i2c.html">I2C</a></li>
<li class="toctree-l1"><a class="reference internal" href="imu/index.html">IMU APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="interrupt.html">Interrupt APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="input/index.html">Input APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="io_expander/index.html">IO Expander APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="joystick.html">Joystick APIs</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="led.html">LED APIs</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="led.html#led">LED</a><ul class="current">
<li class="toctree-l3 current"><a class="current reference internal" href="#">LED Example</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#how-to-use-example">How to use example</a></li>
<li class="toctree-l4"><a class="reference internal" href="#example-output">Example Output</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="led.html#api-reference">API Reference</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="led_strip.html">LED Strip APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="logger.html">Logging APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="monitor.html">Monitoring APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="motorgo_mini.html">MotorGo Mini</a></li>
<li class="toctree-l1"><a class="reference internal" href="math/index.html">Math APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="matouch_rotary_display.html">MaTouch Rotary Display</a></li>
<li class="toctree-l1"><a class="reference internal" href="neopixel.html">Neopixel APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="network/index.html">Network APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="nfc/index.html">NFC APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="nvs.html">NVS APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="pid.html">PID APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="qtpy.html">QtPy ESP32 Pico and QtPy ESP32-S3</a></li>
<li class="toctree-l1"><a class="reference internal" href="qwiicnes.html">QwiicNES</a></li>
<li class="toctree-l1"><a class="reference internal" href="rmt.html">Remote Control Transceiver (RMT)</a></li>
<li class="toctree-l1"><a class="reference internal" href="rtc/index.html">RTC APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="rtsp.html">RTSP APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="runqueue.html">RunQueue APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="seeed_studio_round_display.html">Seeed Studio Round Display</a></li>
<li class="toctree-l1"><a class="reference internal" href="serialization.html">Serialization APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="state_machine.html">State Machine APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="t_deck.html">LilyGo T-Deck</a></li>
<li class="toctree-l1"><a class="reference internal" href="t_dongle_s3.html">LilyGo T-Dongle S3</a></li>
<li class="toctree-l1"><a class="reference internal" href="tabulate.html">Tabulate APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="task.html">Task APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="thermistor.html">Thermistor APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="timer.html">Timer APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="wifi/index.html">WiFi APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="wrover_kit.html">ESP32-WROVER-KIT</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">ESPP</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home"></a> »</li>
<li><a href="led.html">LED APIs</a> »</li>
<li>LED Example</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/esp-cpp/espp/blob/582c61e0/docs/en/led_example.md" class="fa fa-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="led-example">
<h1>LED Example<a class="headerlink" href="#led-example" title="Permalink to this headline"></a></h1>
<p>This example shows how to use the <code class="docutils literal notranslate"><span class="pre">espp::Led</span></code> class to control the LED using the
ESP32 hardware.</p>
<section id="how-to-use-example">
<h2>How to use example<a class="headerlink" href="#how-to-use-example" title="Permalink to this headline"></a></h2>
<section id="hardware-required">
<h3>Hardware Required<a class="headerlink" href="#hardware-required" title="Permalink to this headline"></a></h3>
<p>This example is designed to be run on the M5Stack ESP32 Timer Cam (using its
LED). If you wish to run on other hardware, just make sure to set the GPIO that
you want to use in the code.</p>
</section>
<section id="build-and-flash">
<h3>Build and Flash<a class="headerlink" href="#build-and-flash" title="Permalink to this headline"></a></h3>
<p>Build the project and flash it to the board, then run monitor tool to view serial output:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">idf</span><span class="o">.</span><span class="n">py</span> <span class="o">-</span><span class="n">p</span> <span class="n">PORT</span> <span class="n">flash</span> <span class="n">monitor</span>
</pre></div>
</div>
<p>(Replace PORT with the name of the serial port to use.)</p>
<p>(To exit the serial monitor, type <code class="docutils literal notranslate"><span class="pre">Ctrl-]</span></code>.)</p>
<p>See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.</p>
</section>
</section>
<section id="example-output">
<h2>Example Output<a class="headerlink" href="#example-output" title="Permalink to this headline"></a></h2>
<p><img alt="output" src="https://user-images.githubusercontent.com/213467/232148065-194dbb01-06c4-4eae-a22b-ebd1ec0cc820.png" /></p>
<p>https://user-images.githubusercontent.com/213467/232148096-a0061f7b-011a-49b1-9354-aa8a3c81034a.mp4</p>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="led.html" class="btn btn-neutral float-left" title="LED APIs" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="led_strip.html" class="btn btn-neutral float-right" title="LED Strip APIs" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2022 - 2025, William Emfinger.</p>
</div>
<ul class="footer">
<li>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/espressif/sphinx_idf_theme">theme</a> based on <a href="https://github.com/readthedocs/sphinx_rtd_theme">Read the Docs Sphinx Theme</a>.
</li>
</ul>
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>