From 827d2c0da39ede4ee70ef1399298031f624d8a4d Mon Sep 17 00:00:00 2001 From: ShiboSoftwareDev Date: Thu, 13 Nov 2025 19:06:21 +0200 Subject: [PATCH] Add switch example for SPICE simulation --- docs/guides/spice-simulation/introduction.mdx | 9 ++++ .../spice-simulation/switch-example.mdx | 44 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 docs/guides/spice-simulation/switch-example.mdx diff --git a/docs/guides/spice-simulation/introduction.mdx b/docs/guides/spice-simulation/introduction.mdx index dd49410..1f5258e 100644 --- a/docs/guides/spice-simulation/introduction.mdx +++ b/docs/guides/spice-simulation/introduction.mdx @@ -61,3 +61,12 @@ Example: | `amplitude` | string or number | Amplitude of the AC signal. For square waves, this is the peak voltage. | | `offset` | string or number | DC offset of the waveform. | | `dutyCycle` | number | For square waves, the fraction of the period the signal is high (0 to 1). | + +### {""} +

+ For simulations, a {""} can be configured to toggle at a + specific frequency. +

+| Property | Type | Description | +| :--- | :--- | :--- | +| `simSwitchFrequency` | string or number | Frequency at which the switch toggles (e.g., `"1kHz"` or `1000`). | diff --git a/docs/guides/spice-simulation/switch-example.mdx b/docs/guides/spice-simulation/switch-example.mdx new file mode 100644 index 0000000..7f39ce7 --- /dev/null +++ b/docs/guides/spice-simulation/switch-example.mdx @@ -0,0 +1,44 @@ +--- +title: Switch Example +sidebar_label: Switch +sidebar_position: 4 +description: An example of using a switch in a SPICE simulation. +--- +import CircuitPreview from "@site/src/components/CircuitPreview" + +

+ This example demonstrates how to use a switch in a SPICE simulation. When + the simSwitchFrequency property is set, an ideal switch will + toggle at the specified frequency. A voltage probe is placed after the switch + to observe the output. +

+ ( + + + + + .pin2", pin2: ".V1 > .terminal2" }} + /> + .pin1"} /> + + +) +`} +/> +

+ The simulation shows the voltage at the node after the switch. Since the + switch is toggling at 1kHz, the voltage probe will show a 1kHz square + wave going between approximately 0V and 5V. +