From 1fa43b380d3b1014121f10b62ca1b5940e06ec83 Mon Sep 17 00:00:00 2001 From: David Montero Date: Thu, 2 Jul 2026 22:38:17 +0200 Subject: [PATCH] fix(examples): add series resistor to ESP32 Blink LED example The esp32-blink-led example wired the external red LED straight from GPIO4 to the anode with no current-limiting resistor. Add a 220 Ohm resistor in series (GPIO4 -> R -> LED anode -> GND) so the example models correct practice and matches the other LED examples. --- frontend/src/data/examples.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/frontend/src/data/examples.ts b/frontend/src/data/examples.ts index 57b39ace..2fe328e2 100644 --- a/frontend/src/data/examples.ts +++ b/frontend/src/data/examples.ts @@ -4316,13 +4316,23 @@ void loop() { delay(500); }`, components: [ - { type: 'wokwi-led', id: 'led-ext', x: 460, y: 190, properties: { color: 'red' } }, + // 220 Ohm current-limiting resistor in series with the external LED — + // never drive an LED straight off a GPIO. (3.3V - ~2V)/220R ~= 6 mA, + // well under the LED's 20 mA rating. + { type: 'wokwi-resistor', id: 'r-led', x: 320, y: 205, properties: { value: '220' } }, + { type: 'wokwi-led', id: 'led-ext', x: 470, y: 190, properties: { color: 'red' } }, ], wires: [ - // GPIO4 → LED anode + // GPIO4 → resistor → LED anode { - id: 'w-gpio4-led', + id: 'w-gpio4-r', start: { componentId: 'arduino-uno', pinName: '4' }, + end: { componentId: 'r-led', pinName: '1' }, + color: '#e74c3c', + }, + { + id: 'w-r-led', + start: { componentId: 'r-led', pinName: '2' }, end: { componentId: 'led-ext', pinName: 'A' }, color: '#e74c3c', },