Skip to content

Commit 44ddffa

Browse files
committed
feat(docs): Update ADC, RMT, and Timer examples to use wokwi-example directive; modify AnalogRead example pin usage
1 parent 8c2635f commit 44ddffa

File tree

9 files changed

+127
-12
lines changed

9 files changed

+127
-12
lines changed

docs/en/api/adc.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,7 @@ Example Applications
274274

275275
Here is an example of how to use the ADC in OneShot mode or you can run Arduino example 01.Basics -> AnalogReadSerial.
276276

277-
.. literalinclude:: ../../../libraries/ESP32/examples/AnalogRead/AnalogRead.ino
278-
:language: arduino
277+
.. wokwi-example:: libraries/ESP32/examples/AnalogRead
279278

280279
Here is an example of how to use the ADC in Continuous mode.
281280

docs/en/api/rmt.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ To get started with RMT, you can try:
1717
RMT Write RGB LED
1818
*****************
1919

20-
.. literalinclude:: ../../../libraries/ESP32/examples/RMT/RMTWrite_RGB_LED/RMTWrite_RGB_LED.ino
21-
:language: arduino
20+
.. wokwi-example:: libraries/ESP32/examples/RMT/RMTWrite_RGB_LED
2221

2322

2423
Complete list of `RMT examples <https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/RMT>`_.

docs/en/api/timer.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,8 @@ There are 2 examples uses of Timer:
215215

216216
Repeat timer example:
217217

218-
.. literalinclude:: ../../../libraries/ESP32/examples/Timer/RepeatTimer/RepeatTimer.ino
219-
:language: arduino
218+
.. wokwi-example:: libraries/ESP32/examples/Timer/RepeatTimer
220219

221220
Watchdog timer example:
222221

223-
.. literalinclude:: ../../../libraries/ESP32/examples/Timer/WatchdogTimer/WatchdogTimer.ino
224-
:language: arduino
222+
.. wokwi-example:: libraries/ESP32/examples/Timer/WatchdogTimer

libraries/ESP32/examples/AnalogRead/AnalogRead.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ void setup() {
77
}
88

99
void loop() {
10-
// read the analog / millivolts value for pin 2:
11-
int analogValue = analogRead(2);
12-
int analogVolts = analogReadMilliVolts(2);
10+
// read the analog / millivolts value for pin 0:
11+
int analogValue = analogRead(0);
12+
int analogVolts = analogReadMilliVolts(0);
1313

1414
// print out the values you read:
1515
Serial.printf("ADC analog value = %d\n", analogValue);
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
upload-binary:
2+
targets:
3+
- esp32s3
4+
- esp32
5+
diagram:
6+
esp32s3:
7+
parts:
8+
- type: wokwi-potentiometer
9+
id: pot1
10+
top: 65.9
11+
left: -115.4
12+
attrs: {}
13+
connections:
14+
- - pot1:VCC
15+
- esp:3V3.2
16+
- red
17+
- - v19.2
18+
- h47.2
19+
- v-115.2
20+
- - pot1:SIG
21+
- esp:0
22+
- green
23+
- - v144
24+
- h191.6
25+
- v-115.2
26+
- - esp:GND.1
27+
- pot1:GND
28+
- black
29+
- - h0
30+
esp32:
31+
parts:
32+
- type: wokwi-potentiometer
33+
id: pot1
34+
top: 37.1
35+
left: -125
36+
attrs: {}
37+
connections:
38+
- - pot1:VCC
39+
- esp:3V3
40+
- red
41+
- - v19.2
42+
- h47.2
43+
- v-96
44+
- - pot1:SIG
45+
- esp:0
46+
- green
47+
- - v124.8
48+
- h210.8
49+
- v-76.8
50+
- - esp:GND.1
51+
- pot1:GND
52+
- black
53+
- - h0

libraries/ESP32/examples/RMT/RMTWrite_RGB_LED/RMTWrite_RGB_LED.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#ifdef PIN_LED_RGB
2424
#define BUILTIN_RGBLED_PIN PIN_LED_RGB
2525
#else
26-
#define BUILTIN_RGBLED_PIN 21 // ESP32 has no builtin RGB LED (PIN_LED_RGB)
26+
#define BUILTIN_RGBLED_PIN 4 // ESP32 has no builtin RGB LED (PIN_LED_RGB)
2727
#endif
2828

2929
#define NR_OF_LEDS 8 * 4
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
upload-binary:
2+
targets:
3+
- esp32h2
4+
- esp32
5+
diagram:
6+
esp32h2:
7+
parts:
8+
- type: wokwi-neopixel-canvas
9+
id: neopixels1
10+
top: 80.9
11+
left: -186
12+
rotate: 270
13+
attrs:
14+
rows: "4"
15+
cols: "8"
16+
matrixBrightness: "255"
17+
connections:
18+
- - esp:4
19+
- neopixels1:DIN
20+
- green
21+
- - h-14.7
22+
- v16.03
23+
- - esp:5V
24+
- neopixels1:VDD
25+
- red
26+
- - h-14.7
27+
- v-21.97
28+
- - esp:GND.2
29+
- neopixels1:VSS
30+
- black
31+
- - h-33.9
32+
- v-55.37
33+
esp32:
34+
parts:
35+
- type: wokwi-neopixel-canvas
36+
id: neopixels1
37+
top: 86.3
38+
left: 107.6
39+
rotate: 90
40+
attrs:
41+
rows: "4"
42+
cols: "8"
43+
matrixBrightness: "255"
44+
connections:
45+
- - esp:4
46+
- neopixels1:DIN
47+
- green
48+
- - h33.64
49+
- v-4.2
50+
- - esp:5V
51+
- neopixels1:VDD
52+
- red
53+
- - v28.8
54+
- h139.39
55+
- v-100.6
56+
- - esp:GND.2
57+
- neopixels1:VSS
58+
- black
59+
- - h24.04
60+
- v106
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
upload-binary:
2+
targets:
3+
- esp32
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
upload-binary:
2+
targets:
3+
- esp32

0 commit comments

Comments
 (0)