velxio/frontend/src/components
David Montero Crespo 55b3dd29e5 fix(DynamicComponent): pass componentId through to PinTracer
`PinTracer` signature is `(componentId, componentPinName) => number | null`
but the local `getArduinoPin` lambda only accepted one arg and used the
closure-captured `id`. When `createDefaultPinResolver` passed both args
(per the typed signature), JS bound the FIRST arg (the componentId) into
the lambda's single `componentPinName` parameter. `traceDetailed` then
looked up a pin literally named "rgb-led-1" on component "rgb-led-1",
returned null, and the resolver locked itself into 'FLOATING' state —
its onChange path never subscribed and the wokwi-rgb-led element's
ledRed/ledGreen/ledBlue stayed at 0 forever even as the SPICE side
correctly cycled through R, G, B, Y, C, M, W via analogWrite().

Same bug latent for any multi-pin component that goes through the
PinResolver path (multi-pin LEDs, RGB strips, 7-seg drivers, anything
that calls `getPinResolver(<pinName>)` for several pin names).

Fix: lambda now accepts both shapes — `getArduinoPin(pinName)` (legacy
single-arg used by every PartSimulationRegistry handler) AND
`getArduinoPin(componentId, pinName)` (PinTracer 2-arg form used by
createDefaultPinResolver / createSpiceResolvedPinResolver). Picks the
right componentId in either case.

Verified via the rgb-led example: ledRed/ledGreen/ledBlue now cycle
0→255→0 in sync with the SPICE node voltages on pins 9/10/11.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 22:08:06 -03:00
..
analog-ui
components-instruments
customChips feat(chips): port retro Intel/Zilog CPUs as Velxio custom chips + 2 demos 2026-05-18 02:27:53 -03:00
editor feat(board-options): per-board options modal + persistence 2026-05-18 21:50:45 -03:00
examples Add HD44780Decoder and various I2C sketches 2026-05-12 14:26:33 -03:00
layout refactor(oss-split): remove auth/admin/profile frontend from OSS 2026-05-14 15:31:12 -03:00
raspberry-pi feat(pi): pluggable slave handler + canvas wire detection for I2C/SPI/UART 2026-05-18 16:26:37 +02:00
simulator feat(board-options): per-board options modal + persistence 2026-05-18 21:50:45 -03:00
ui
velxio-components feat(components): swap BMP280 + ATtiny85 to fritzing art 2026-05-08 23:06:44 -03:00
ComponentPickerModal.css
ComponentPickerModal.tsx feat(editor): translate ComponentPicker + LibraryManager modals (Editor block 7) 2026-05-09 11:29:07 -03:00
DynamicComponent.tsx fix(DynamicComponent): pass componentId through to PinTracer 2026-05-18 22:08:06 -03:00