velxio/frontend/src/simulation/spice
David Montero Crespo 9b0b4bc038 fix(examples): night-light LDR shorted AO to VCC — "1M" is milliohms in SPICE
100d-auto-night-light shipped `dark: "1M"` meaning 1 megaohm. The value
parser follows the SPICE convention where M is MILLI and mega is `Meg`,
so the dark resistance became 0.001 ohm. With the divider's top leg a
short, AO sat at VCC: `ldr.read()` returned 4095 on every sample, the
sketch's `light < 500` branch never ran, and the lamp LED never lit.
Dragging the lux control changed nothing either, because every lux value
still divides a short (measured n1 = 3.299999996 V, which is exactly what
100k / (100k + 0.00011) predicts).

The netlist snapshot had frozen the bug in place:

  - R_night-ldr_ldr vcc_rail n1 0.00011111111111111112
  + R_night-ldr_ldr vcc_rail n1 111111.11111111111

Diagram now says "1Meg" (regenerated from test/test_100_days), and the
mapper clamps a sub-1k dark resistance to the documented 1Meg default
with a console warning naming the milli/mega trap — a photoresistor that
reads as a short is always this mistake, and it fails in the most
confusing way possible: the part looks alive, it just never moves.
2026-08-17 03:39:47 +02:00
..
adapters
…
models
…
ports
…
wasm
…
CircuitSimulationService.ts fix(sim): stop dropping sibling pin edges — only bit 0 of a multi-pin write reached the canvas 2026-08-16 20:02:58 +02:00
MixedModeScheduler.ts
…
NetlistBuilder.ts fix(spice): per-voltage supply rails — VIN/5V no longer clamped to the 3.3V logic rail 2026-08-15 08:29:39 +02:00
boardPinGroups.ts fix(spice): per-voltage supply rails — VIN/5V no longer clamped to the 3.3V logic rail 2026-08-15 08:29:39 +02:00
collectPinStates.ts fix(spice): per-voltage supply rails — VIN/5V no longer clamped to the 3.3V logic rail 2026-08-15 08:29:39 +02:00
componentToSpice.ts fix(examples): night-light LDR shorted AO to VCC — "1M" is milliohms in SPICE 2026-08-17 03:39:47 +02:00
connectAnalogInputsToMcu.ts fix(spice): per-voltage supply rails — VIN/5V no longer clamped to the 3.3V logic rail 2026-08-15 08:29:39 +02:00
connectChipInputsToSolve.ts
…
connectDigitalInputsToMcu.ts
…
connectMcuEdgesToService.ts
…
electricalResolveHook.ts
…
probes.ts fix(spice): per-voltage supply rails — VIN/5V no longer clamped to the 3.3V logic rail 2026-08-15 08:29:39 +02:00
runNetlist.ts
…
start.ts
…
storeAdapter.ts fix(spice): per-voltage supply rails — VIN/5V no longer clamped to the 3.3V logic rail 2026-08-15 08:29:39 +02:00
types.ts fix(spice): per-voltage supply rails — VIN/5V no longer clamped to the 3.3V logic rail 2026-08-15 08:29:39 +02:00
unionFind.ts fix(spice): per-voltage supply rails — VIN/5V no longer clamped to the 3.3V logic rail 2026-08-15 08:29:39 +02:00
valueParser.ts
…
waveformStats.ts
…