feat(examples): mixed digital+analog coexistence demo (MCU + AND gate + transistor)
A board example proving digital and analog coexist in ONE circuit: the Arduino drives two logic levels, a physical AND gate combines them, and the AND output switches an NPN 2N2222 transistor that drives the "motor" LED. Verified live: it compiles, the MCU drives the AND gate (5 V), the transistor conducts and the LED lights — MCU -> logic gate -> transistor -> load works across the digital and ngspice motors together. Known limitation (sim-mixedmode step 2, pending): the ngspice side does not re-solve on every MCU pin edge, so a fast (1 Hz) blink does not track in real time — the analog output changes on a slower cadence. User-driven / slow changes track fine. Snapshot updated for the new example. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a5edeb74c7
commit
70558eb31b
|
|
@ -1024,7 +1024,7 @@ R_vm_vmR n0 0 10Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > and-gate-alarm 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > and-gate-alarm 1`] = `
|
||||
"* Velxio circuit
|
||||
V_src n1 0 DC 5
|
||||
R_sw1 n1 n2 1000000000
|
||||
|
|
@ -1041,7 +1041,7 @@ D_led1 led1_sense_mid 0 LED_RED
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > battery-voltage-monitor 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > battery-voltage-monitor 1`] = `
|
||||
"* Velxio circuit
|
||||
R_r2 n0 n1 10000
|
||||
R_autopull_n0 n0 0 100Meg
|
||||
|
|
@ -1050,7 +1050,7 @@ R_autopull_n1 n1 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > binary-counter-leds 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > binary-counter-leds 1`] = `
|
||||
"* Velxio circuit
|
||||
R_r0 n0 n5 220
|
||||
R_r1 n1 n6 220
|
||||
|
|
@ -1081,7 +1081,7 @@ R_autopull_n8 n8 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > bjt-common-emitter 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > bjt-common-emitter 1`] = `
|
||||
"* Velxio circuit
|
||||
R_rb1 n0 n2 47000
|
||||
R_rb2 n2 0 10000
|
||||
|
|
@ -1095,7 +1095,7 @@ R_rin n4 n2 10000
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > capacitor-charge-curve 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > capacitor-charge-curve 1`] = `
|
||||
"* Velxio circuit
|
||||
R_r1 n0 n2 10000
|
||||
C_c1 n2 n1 0.00009999999999999999 IC=0
|
||||
|
|
@ -1106,7 +1106,7 @@ R_autopull_n2 n2 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > darlington-high-current 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > darlington-high-current 1`] = `
|
||||
"* Velxio circuit
|
||||
R_rb n1 n5 10000
|
||||
R_rl n0 n6 220
|
||||
|
|
@ -1127,7 +1127,7 @@ R_autopull_n6 n6 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > diode-rectifier 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > diode-rectifier 1`] = `
|
||||
"* Velxio circuit
|
||||
V_sg1 n1 0 SIN(0 5 50)
|
||||
D_d1 n1 n0 D1N4007
|
||||
|
|
@ -1137,7 +1137,7 @@ R_rl n0 0 1000
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > esp32-dual-adc 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > esp32-dual-adc 1`] = `
|
||||
"* Velxio circuit
|
||||
V_VCC_RAIL vcc_rail 0 DC 5
|
||||
R_pot1_top vcc_rail n0 10000
|
||||
|
|
@ -1148,7 +1148,7 @@ R_pot2_bot n1 0 1
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > esp32-pwm-led-rgb 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > esp32-pwm-led-rgb 1`] = `
|
||||
"* Velxio circuit
|
||||
R_rr n0 n6 220
|
||||
R_rg n1 n4 220
|
||||
|
|
@ -1164,7 +1164,7 @@ R_autopull_n6 n6 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > full-adder 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > full-adder 1`] = `
|
||||
"* Velxio circuit
|
||||
R_bA n0 n5 1000000000
|
||||
R_bB n1 n5 1000000000
|
||||
|
|
@ -1189,7 +1189,7 @@ R_autopull_n7 n7 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > l293d-motor-control 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > l293d-motor-control 1`] = `
|
||||
"* Velxio circuit
|
||||
B_u1_ch1a n4 0 V = u(V(n3)-2.5) * u(V(n1)-2.5) * V(n0)
|
||||
R_u1_ch1a_load n4 0 10Meg
|
||||
|
|
@ -1204,7 +1204,7 @@ R_autopull_n3 n3 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > l293d-speed-pwm 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > l293d-speed-pwm 1`] = `
|
||||
"* Velxio circuit
|
||||
V_VCC_RAIL vcc_rail 0 DC 5
|
||||
R_pot_top vcc_rail n3 10000
|
||||
|
|
@ -1221,7 +1221,7 @@ R_autopull_n2 n2 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > led-current-limiting 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > led-current-limiting 1`] = `
|
||||
"* Velxio circuit
|
||||
R_r1 n0 n2 330
|
||||
V_led1_sense n2 led1_sense_mid DC 0
|
||||
|
|
@ -1234,7 +1234,7 @@ R_autopull_n2 n2 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > lm317-adjustable-psu 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > lm317-adjustable-psu 1`] = `
|
||||
"* Velxio circuit
|
||||
V_bat n0 bat_int DC 9
|
||||
R_bat_esr bat_int n1 1.5
|
||||
|
|
@ -1248,7 +1248,7 @@ R_autopull_n0 n0 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > logic-probe 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > logic-probe 1`] = `
|
||||
"* Velxio circuit
|
||||
V_gLed_sense n3 gLed_sense_mid DC 0
|
||||
D_gLed gLed_sense_mid n2 LED_GREEN
|
||||
|
|
@ -1267,7 +1267,7 @@ R_autopull_n4 n4 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > mega-multi-led 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > mega-multi-led 1`] = `
|
||||
"* Velxio circuit
|
||||
V_led0_sense n9 led0_sense_mid DC 0
|
||||
D_led0 led0_sense_mid n8 LED_RED
|
||||
|
|
@ -1315,7 +1315,28 @@ R_autopull_n16 n16 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > mosfet-pwm-led 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > mixed-and-transistor-driver 1`] = `
|
||||
"* Velxio circuit
|
||||
B_u1 n7 0 V = 5 * u(V(n0)-2.5) * u(V(n2)-2.5)
|
||||
R_u1_load n7 0 1Meg
|
||||
R_rb n7 n5 1000
|
||||
Q_q1 n3 n5 n4 Q2N2222
|
||||
R_rl n1 n6 220
|
||||
V_motor_sense n6 motor_sense_mid DC 0
|
||||
D_motor motor_sense_mid n3 LED_GREEN
|
||||
R_autopull_n0 n0 0 100Meg
|
||||
R_autopull_n1 n1 0 100Meg
|
||||
R_autopull_n2 n2 0 100Meg
|
||||
R_autopull_n3 n3 0 100Meg
|
||||
R_autopull_n4 n4 0 100Meg
|
||||
R_autopull_n6 n6 0 100Meg
|
||||
.model Q2N2222 NPN(IS=1E-14 VAF=100 BF=200 IKF=0.3 XTB=1.5 BR=3 CJC=8E-12 CJE=25E-12 TR=100E-9 TF=400E-12 ITF=1 VTF=2 XTF=3 RB=10 RC=.3 RE=.2)
|
||||
.model LED_GREEN D(Is=1e-22 N=1.9)
|
||||
.op
|
||||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (41 examples) > mosfet-pwm-led 1`] = `
|
||||
"* Velxio circuit
|
||||
R_rl n0 n4 220
|
||||
V_led1_sense n4 led1_sense_mid DC 0
|
||||
|
|
@ -1333,7 +1354,7 @@ R_autopull_n4 n4 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > multi-led-bar 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > multi-led-bar 1`] = `
|
||||
"* Velxio circuit
|
||||
R_r0 n0 n6 220
|
||||
R_r1 n1 n7 220
|
||||
|
|
@ -1370,7 +1391,7 @@ R_autopull_n10 n10 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > nand-sr-latch 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > nand-sr-latch 1`] = `
|
||||
"* Velxio circuit
|
||||
R_setBtn n5 n6 1000000000
|
||||
R_rstBtn n4 n6 1000000000
|
||||
|
|
@ -1392,7 +1413,7 @@ R_autopull_n6 n6 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > nano-sensor-station 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > nano-sensor-station 1`] = `
|
||||
"* Velxio circuit
|
||||
V_VCC_RAIL vcc_rail 0 DC 5
|
||||
R_ntc_ntc vcc_rail n1 11441.484668193882
|
||||
|
|
@ -1403,7 +1424,7 @@ R_ldr_pull n0 0 10000
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > npn-led-switch 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > npn-led-switch 1`] = `
|
||||
"* Velxio circuit
|
||||
R_rb n1 n4 1000
|
||||
R_rc n0 n5 220
|
||||
|
|
@ -1422,7 +1443,7 @@ R_autopull_n5 n5 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > ntc-temperature 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > ntc-temperature 1`] = `
|
||||
"* Velxio circuit
|
||||
V_VCC_RAIL vcc_rail 0 DC 5
|
||||
R_ntc_ntc vcc_rail n0 10000
|
||||
|
|
@ -1431,7 +1452,7 @@ R_ntc_pull n0 0 10000
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > opamp-comparator 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > opamp-comparator 1`] = `
|
||||
"* Velxio circuit
|
||||
V_VCC_RAIL vcc_rail 0 DC 5
|
||||
R_pot_top vcc_rail n0 10000
|
||||
|
|
@ -1492,7 +1513,7 @@ RL3 22 28 100K
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > opamp-difference 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > opamp-difference 1`] = `
|
||||
"* Velxio circuit
|
||||
V_VCC_RAIL vcc_rail 0 DC 5
|
||||
R_r1 n0 n2 10000
|
||||
|
|
@ -1553,7 +1574,7 @@ RL3 22 28 100K
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > opamp-inverting 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > opamp-inverting 1`] = `
|
||||
"* Velxio circuit
|
||||
V_VCC_RAIL vcc_rail 0 DC 5
|
||||
R_pot_top vcc_rail n0 10000
|
||||
|
|
@ -1612,7 +1633,7 @@ RL3 22 28 100K
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > opamp-schmitt-trigger 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > opamp-schmitt-trigger 1`] = `
|
||||
"* Velxio circuit
|
||||
V_VCC_RAIL vcc_rail 0 DC 5
|
||||
R_pot_top vcc_rail n0 10000
|
||||
|
|
@ -1671,7 +1692,7 @@ RL3 22 28 100K
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > opamp-voltage-follower 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > opamp-voltage-follower 1`] = `
|
||||
"* Velxio circuit
|
||||
V_VCC_RAIL vcc_rail 0 DC 5
|
||||
R_pot_top vcc_rail n0 10000
|
||||
|
|
@ -1726,7 +1747,7 @@ RL3 22 28 100K
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > optocoupler-signal 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > optocoupler-signal 1`] = `
|
||||
"* Velxio circuit
|
||||
R_rled n1 n2 270
|
||||
D_u1_led n2 u1_mid DLED_OPTO
|
||||
|
|
@ -1744,7 +1765,7 @@ R_autopull_n4 n4 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > parallel-resistors 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > parallel-resistors 1`] = `
|
||||
"* Velxio circuit
|
||||
R_rs n0 n2 10000
|
||||
R_r1 n2 n1 10000
|
||||
|
|
@ -1757,7 +1778,7 @@ R_autopull_n2 n2 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > photoresistor-light 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > photoresistor-light 1`] = `
|
||||
"* Velxio circuit
|
||||
V_VCC_RAIL vcc_rail 0 DC 5
|
||||
R_ldr_ldr vcc_rail n0 285714.28571428574
|
||||
|
|
@ -1766,7 +1787,7 @@ R_ldr_pull n0 0 10000
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > pnp-high-side-switch 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > pnp-high-side-switch 1`] = `
|
||||
"* Velxio circuit
|
||||
R_rb n0 n4 1000
|
||||
R_rl n2 n5 220
|
||||
|
|
@ -1785,7 +1806,7 @@ R_autopull_n5 n5 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > pot-adc-reader 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > pot-adc-reader 1`] = `
|
||||
"* Velxio circuit
|
||||
V_VCC_RAIL vcc_rail 0 DC 5
|
||||
R_pot_top vcc_rail n0 10000
|
||||
|
|
@ -1794,7 +1815,7 @@ R_pot_bot n0 0 1
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > power-supply-7805 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > power-supply-7805 1`] = `
|
||||
"* Velxio circuit
|
||||
V_bat n0 bat_int DC 9
|
||||
R_bat_esr bat_int 0 1.5
|
||||
|
|
@ -1806,7 +1827,7 @@ R_autopull_n0 n0 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > rc-low-pass-filter 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > rc-low-pass-filter 1`] = `
|
||||
"* Velxio circuit
|
||||
R_r1 n0 n2 10000
|
||||
C_c1 n2 n1 0.000009999999999999999 IC=0
|
||||
|
|
@ -1817,7 +1838,7 @@ R_autopull_n2 n2 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > relay-led-switch 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > relay-led-switch 1`] = `
|
||||
"* Velxio circuit
|
||||
R_rb n1 n3 1000
|
||||
Q_q1 n5 n3 n2 Q2N2222
|
||||
|
|
@ -1843,7 +1864,7 @@ R_autopull_n6 n6 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > schottky-reverse-protection 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > schottky-reverse-protection 1`] = `
|
||||
"* Velxio circuit
|
||||
V_bat n0 bat_int DC 9
|
||||
R_bat_esr bat_int n2 1.5
|
||||
|
|
@ -1857,7 +1878,7 @@ R_autopull_n2 n2 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > voltage-divider 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > voltage-divider 1`] = `
|
||||
"* Velxio circuit
|
||||
R_r1 n0 n1 10000
|
||||
R_r2 n1 n2 10000
|
||||
|
|
@ -1868,7 +1889,7 @@ R_autopull_n2 n2 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > wheatstone-bridge 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > wheatstone-bridge 1`] = `
|
||||
"* Velxio circuit
|
||||
R_r1 n0 n1 10000
|
||||
R_r2 n0 n2 10000
|
||||
|
|
@ -1882,7 +1903,7 @@ R_autopull_n3 n3 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > xor-toggle-detector 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > xor-toggle-detector 1`] = `
|
||||
"* Velxio circuit
|
||||
R_sw1 n0 n5 1000000000
|
||||
R_sw2 n1 n5 1000000000
|
||||
|
|
@ -1901,7 +1922,7 @@ R_autopull_n5 n5 0 100Meg
|
|||
.end"
|
||||
`;
|
||||
|
||||
exports[`netlist snapshot — circuits (40 examples) > zener-regulator 1`] = `
|
||||
exports[`netlist snapshot — circuits (41 examples) > zener-regulator 1`] = `
|
||||
"* Velxio circuit
|
||||
V_bat n0 bat_int DC 9
|
||||
R_bat_esr bat_int n2 1.5
|
||||
|
|
|
|||
|
|
@ -856,6 +856,47 @@ void loop() {
|
|||
// LOGIC GATES (6 examples)
|
||||
// ════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
{
|
||||
id: 'mixed-and-transistor-driver',
|
||||
title: 'Mixed: MCU + AND gate + transistor (coexistence test)',
|
||||
description:
|
||||
'Coexistence of digital and analog in ONE circuit: the Arduino drives two ' +
|
||||
'logic levels (one steady HIGH "enable", one blinking), a physical AND gate ' +
|
||||
'combines them, and the AND output switches an NPN transistor that drives the ' +
|
||||
'"motor" LED. The LED should blink — proving MCU -> logic gate -> transistor ' +
|
||||
'-> load works through the digital and analog (ngspice) motors together.',
|
||||
category: 'circuits',
|
||||
difficulty: 'intermediate',
|
||||
code: `// MCU + AND gate + transistor coexistence.
|
||||
// pin 5 = steady enable, pin 6 = blink. AND(5,6) -> transistor -> motor LED.
|
||||
void setup() { pinMode(5, OUTPUT); pinMode(6, OUTPUT); }
|
||||
void loop() {
|
||||
digitalWrite(5, HIGH); // enable
|
||||
digitalWrite(6, (millis() / 500) & 1); // ~1 Hz blink
|
||||
}`,
|
||||
components: [
|
||||
UNO,
|
||||
{ type: 'velxio-logic-gate-and', id: 'u1', x: 360, y: 120, properties: {} },
|
||||
{ type: 'wokwi-resistor', id: 'rb', x: 480, y: 130, properties: { value: '1000' } },
|
||||
{ type: 'wokwi-bjt-2n2222', id: 'q1', x: 580, y: 160, properties: {} },
|
||||
{ type: 'wokwi-resistor', id: 'rl', x: 560, y: 40, properties: { value: '220' } },
|
||||
{ type: 'wokwi-led', id: 'motor', x: 560, y: 100, properties: { color: 'green' } },
|
||||
],
|
||||
wires: [
|
||||
// MCU drives the two AND inputs
|
||||
w('w1', ['arduino-uno', '5'], ['u1', 'A']),
|
||||
w('w2', ['arduino-uno', '6'], ['u1', 'B']),
|
||||
// AND output -> base resistor -> transistor base
|
||||
w('w3', ['u1', 'Y'], ['rb', '1']),
|
||||
w('w4', ['rb', '2'], ['q1', 'B']),
|
||||
// Load: 5V -> Rl -> LED -> collector ; emitter -> GND
|
||||
w('w5', ['arduino-uno', '5V'], ['rl', '1'], '#ff3030'),
|
||||
w('w6', ['rl', '2'], ['motor', 'A']),
|
||||
w('w7', ['motor', 'C'], ['q1', 'C']),
|
||||
w('w8', ['q1', 'E'], ['arduino-uno', 'GND'], '#000000'),
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
id: 'and-gate-alarm',
|
||||
title: 'AND Gate Alarm',
|
||||
|
|
|
|||
Loading…
Reference in New Issue