tinsangbeeping/my_led_testing

This code defines a React component that creates an electronic module with an 8-pin microcontroller (like ATMEGA328P) connected to an external 2-pin header, including an internal signal path with a resistor and LED for visual indication, plus optional decoupling capacitor.

Version
0.0.1
License
unset
Stars
0

dist/schematic.svg

PCBPCB preview for dist/schematic.svg
SchematicSchematic preview for dist/schematic.svg
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="600" style="background-color: rgb(245, 241, 237)" data-real-to-screen-transform="matrix(18.1176195864,0,0,-18.1176195864,191.085325936,853.2843218172)" data-software-used-string="@tscircuit/core@0.0.1015"><style>
              .boundary { fill: rgb(245, 241, 237); }
              .schematic-boundary { fill: none; stroke: #fff; }
              .component { fill: none; stroke: rgb(132, 0, 0); }
              .chip { fill: rgb(255, 255, 194); stroke: rgb(132, 0, 0); }
              .component-pin { fill: none; stroke: rgb(132, 0, 0); }
              /* Basic per-trace hover fallback */
              .trace:hover {
                filter: invert(1);
              }
              .trace:hover .trace-crossing-outline {
                opacity: 0;
              }
              .trace:hover .trace-junction {
                filter: invert(1);
              }
              /* Net-hover highlighting: when a trace or its overlays are hovered,
                 invert color for all traces (base + overlays) sharing the same
                 subcircuit connectivity key. Also hide crossing outline during hover. */
              svg:has(:is(g.trace[data-subcircuit-connectivity-map-key="undefined"], g.trace-overlays[data-subcircuit-connectivity-map-key="undefined"]):hover) :is(g.trace[data-subcircuit-connectivity-map-key="undefined"], g.trace-overlays[data-subcircuit-connectivity-map-key="undefined"]) { filter: invert(1); }
svg:has(:is(g.trace[data-subcircuit-connectivity-map-key="undefined"], g.trace-overlays[data-subcircuit-connectivity-map-key="undefined"]):hover) g.trace-overlays[data-subcircuit-connectivity-map-key="undefined"] .trace-crossing-outline { opacity: 0; }
              .text { font-family: sans-serif; fill: rgb(0, 150, 0); }
              .pin-number { fill: rgb(169, 0, 0); }
              .port-label { fill: rgb(0, 100, 100); }
              .component-name { fill: rgb(0, 100, 100); }
            </style><rect class="boundary" x="0" y="0" width="1200" height="600"/><g class="trace" data-layer="base" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_0"><path d="M 473.72019148384 579.7082660625599 L 535.77303856726 579.7082660625599 L 535.77303856726 291.63811463879995 L 597.82588565068 291.63811463879995" class="trace-invisible-hover-outline" stroke="rgb(0, 150, 0)" fill="none" stroke-width="2.898819133824px" stroke-linecap="round" opacity="0" stroke-linejoin="round"/><path d="M 473.72019148384 579.7082660625599 L 535.77303856726 579.7082660625599 L 535.77303856726 291.63811463879995 L 597.82588565068 291.63811463879995" stroke="rgb(0, 150, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round" stroke-linejoin="round"/></g><g class="trace" data-layer="base" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_1"><path d="M 617.7552671957201 291.63811463879995 L 621.378791113 291.63811463879995 L 621.378791113 201.05001670679997 L 593.9305974396041 201.05001670679997 L 593.9305974396041 110.46191877479998 L 597.554121356884 110.46191877479998" class="trace-invisible-hover-outline" stroke="rgb(0, 150, 0)" fill="none" stroke-width="2.898819133824px" stroke-linecap="round" opacity="0" stroke-linejoin="round"/><path d="M 617.7552671957201 291.63811463879995 L 621.378791113 291.63811463879995 L 621.378791113 201.05001670679997 L 593.9305974396041 201.05001670679997 L 593.9305974396041 110.46191877479998 L 597.554121356884 110.46191877479998" stroke="rgb(0, 150, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round" stroke-linejoin="round"/></g><g class="trace" data-layer="base" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_2"><path d="M 618.027031489516 110.46191877479998 L 621.650555406796 110.46191877479998 L 621.650555406796 121.69484291836807 L 802.554986977 121.69484291836807 L 802.554986977 110.46191877479998 L 798.9314630597199 110.46191877479998" class="trace-invisible-hover-outline" stroke="rgb(0, 150, 0)" fill="none" stroke-width="2.898819133824px" stroke-linecap="round" opacity="0" stroke-linejoin="round"/><path d="M 618.027031489516 110.46191877479998 L 621.650555406796 110.46191877479998 L 621.650555406796 121.69484291836807 L 802.554986977 121.69484291836807 L 802.554986977 110.46191877479998 L 798.9314630597199 110.46191877479998" stroke="rgb(0, 150, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round" stroke-linejoin="round"/></g><g class="trace-overlays" data-layer="overlay" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_0"/><g class="trace-overlays" data-layer="overlay" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_1"/><g class="trace-overlays" data-layer="overlay" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_2"/><g data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_0"><rect class="component chip" x="459.22609581472" y="576.08474214528" width="7.247047834560021" height="10.870571751840089" stroke-width="0.362352391728px" fill="rgb(255, 255, 194)" stroke="rgb(132, 0, 0)"/><rect class="component-overlay" x="459.22609581472" y="576.08474214528" width="7.247047834560021" height="10.870571751840089" fill="transparent"/><text x="459.22609581472" y="589.310604443352" fill="#006464" text-anchor="start" dominant-baseline="middle" font-family="sans-serif" font-size="3.2611715255519997px" transform="rotate(0, 459.22609581472, 589.310604443352)"></text><text x="459.22609581472" y="573.7294515990479" fill="#006464" text-anchor="start" dominant-baseline="middle" font-family="sans-serif" font-size="3.2611715255519997px" transform="rotate(0, 459.22609581472, 573.7294515990479)">PWRCTRL1_J1</text><line class="component-pin" x1="466.47314364928" y1="579.7082660625599" x2="473.72019148384" y2="579.7082660625599" stroke-width="0.362352391728px"/><g data-schematic-port-id="source_port_0"><rect x="473.357839092112" y="579.3459136708319" width="0.724704783456" height="0.724704783456" opacity="0"/></g><text class="pin-number" x="470.09666756656003" y="579.345913670832" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="2.71764293796px" transform="">1</text><line class="component-pin" x1="466.47314364928" y1="583.3317899798399" x2="473.72019148384" y2="583.3317899798399" stroke-width="0.362352391728px"/><g data-schematic-port-id="source_port_1"><rect x="473.357839092112" y="582.9694375881119" width="0.724704783456" height="0.724704783456" opacity="0"/></g><text class="pin-number" x="470.09666756656003" y="582.969437588112" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="2.71764293796px" transform="">2</text></g><g data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_1"><rect class="component chip" x="912.1665854747199" y="396.72030823992" width="7.247047834560135" height="7.2470478345599645" stroke-width="0.362352391728px" fill="rgb(255, 255, 194)" stroke="rgb(132, 0, 0)"/><rect class="component-overlay" x="912.1665854747199" y="396.72030823992" width="7.247047834560135" height="7.2470478345599645" fill="transparent"/><text x="912.1665854747199" y="406.3226466207119" fill="#006464" text-anchor="start" dominant-baseline="middle" font-family="sans-serif" font-size="3.2611715255519997px" transform="rotate(0, 912.1665854747199, 406.3226466207119)">ATMEGA328P</text><text x="912.1665854747199" y="394.365017693688" fill="#006464" text-anchor="start" dominant-baseline="middle" font-family="sans-serif" font-size="3.2611715255519997px" transform="rotate(0, 912.1665854747199, 394.365017693688)">PWRCTRL1_U1</text></g><g data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_2"><rect class="component-overlay" x="597.8258856506799" y="289.282824092568" width="19.929381545040087" height="4.8917572883279945" fill="transparent"/><path d="M 597.8258856506799 291.6381146388 L 602.8988191348719 291.6381146388" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 612.501157515664 291.6381146388 L 617.75526719572 291.6381146388" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 607.7905764231999 289.282824092568 L 612.501157515664 289.282824092568 L 612.501157515664 294.174581380896 L 602.8988191348719 294.174581380896 L 602.8988191348719 289.282824092568 L 607.7905764231999 289.282824092568" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><text x="607.4282240314719" y="288.4138108747557" stroke="rgb(245, 241, 237)" stroke-width="0.362352391728px" paint-order="stroke" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="auto" font-size="3.2611715255519997px">PWRCTRL1_R1</text><text x="607.4282240314719" y="295.4059469904363" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="hanging" font-size="3.2611715255519997px">10kΩ</text></g><g data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_3"><rect class="component-overlay" x="598.007061846544" y="104.66428050715199" width="19.567029153311978" height="8.334105009743993" fill="transparent"/><path d="M 610.327043165296 110.46191877479998 L 605.435285876968 112.99838551689598" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 610.1458669694321 110.46191877479998 L 617.574090999856 110.46191877479998" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 605.435285876968 108.10662822856798 L 610.327043165296 110.46191877479998" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 605.435285876968 112.99838551689598 L 605.435285876968 108.10662822856798" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 610.327043165296 108.10662822856798 L 610.327043165296 112.99838551689598" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 605.435285876968 110.46191877479998 L 598.007061846544 110.46191877479998" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 610.689395557024 105.207809094744 L 612.3199813198 105.02663289888 L 611.776452732208 106.65721866165599" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 609.239985990112 107.381923445112 L 609.4211621859761 107.381923445112 L 611.595276536344 105.57016148647199 L 611.595276536344 105.57016148647199" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 607.428224031472 104.845456703016 L 609.239985990112 104.66428050715199 L 608.515281206656 106.294866269928" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 605.9788144645601 107.01957105338398 L 606.159990660424 106.83839485751999 L 608.515281206656 105.207809094744 L 608.515281206656 105.207809094744" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><text x="607.7905764232" y="114.22061888794397" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="hanging" font-size="3.2611715255519997px">red</text><text x="607.7905764232" y="103.079694744376" stroke="rgb(245, 241, 237)" stroke-width="0.362352391728px" paint-order="stroke" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="auto" font-size="3.2611715255519997px">PWRCTRL1_LED1</text></g><g data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_4"><rect class="component-overlay" x="779.0020815146801" y="105.751337682336" width="19.92938154503986" height="9.602338380791949" fill="transparent"/><path d="M 798.9314630597199 110.46191877479998 L 790.235005658248 110.46191877479998" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 787.336186524424 110.46191877479998 L 779.0020815146801 110.46191877479998" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 790.235005658248 105.751337682336 L 790.235005658248 115.35367606312795" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 787.336186524424 105.751337682336 L 787.336186524424 115.35367606312795" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><text x="788.785596091336" y="103.26787094024002" stroke="rgb(245, 241, 237)" stroke-width="0.362352391728px" paint-order="stroke" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="auto" font-size="3.2611715255519997px">PWRCTRL1_C1</text><text x="788.9667722872" y="118.38067139281594" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="hanging" font-size="3.2611715255519997px">100nF</text></g><g data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_5"><rect class="component-overlay" x="271.70873309548" y="126.22424781496791" width="19.929381545039973" height="4.891757288328009" fill="transparent"/><path d="M 271.70873309548 128.57953836119992 L 276.781666579672 128.57953836119992" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 286.384004960464 128.57953836119992 L 291.63811464052 128.57953836119992" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><path d="M 281.673423868 126.22424781496791 L 286.384004960464 126.22424781496791 L 286.384004960464 131.11600510329592 L 276.781666579672 131.11600510329592 L 276.781666579672 126.22424781496791 L 281.673423868 126.22424781496791" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.362352391728px" stroke-linecap="round"/><text x="281.311071476272" y="125.35523459715566" stroke="rgb(245, 241, 237)" stroke-width="0.362352391728px" paint-order="stroke" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="auto" font-size="3.2611715255519997px">R_EXT</text><text x="281.311071476272" y="132.34737071283618" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="hanging" font-size="3.2611715255519997px">1kΩ</text><circle cx="271.70873309548" cy="128.57953836119992" r="0.362352391728px" stroke-width="0.362352391728px" fill="none" stroke="rgb(132, 0, 0)"/><circle cx="291.63811464052" cy="128.57953836119992" r="0.362352391728px" stroke-width="0.362352391728px" fill="none" stroke="rgb(132, 0, 0)"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_0"><circle cx="473.72019148384" cy="579.7082660625599" r="0.724704783456" fill="red" opacity="0"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_1"><circle cx="473.72019148384" cy="583.3317899798399" r="0.724704783456" fill="red" opacity="0"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_2"><circle cx="597.82588565068" cy="291.63811463879995" r="0.724704783456" fill="red" opacity="0"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_3"><circle cx="617.7552671957201" cy="291.63811463879995" r="0.724704783456" fill="red" opacity="0"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_4"><circle cx="598.007061846544" cy="110.46191877479998" r="0.724704783456" fill="red" opacity="0"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_5"><circle cx="617.574090999856" cy="110.46191877479998" r="0.724704783456" fill="red" opacity="0"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_6"><circle cx="779.0020815146801" cy="110.46191877479998" r="0.724704783456" fill="red" opacity="0"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_7"><circle cx="798.9314630597199" cy="110.46191877479998" r="0.724704783456" fill="red" opacity="0"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_8"><circle cx="271.70873309548" cy="128.57953836119998" r="0.724704783456" fill="red" opacity="0"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_9"><circle cx="291.63811464052003" cy="128.57953836119998" r="0.724704783456" fill="red" opacity="0"/></g><path class="net-label" d="
    M 504.74661502555,579.7082660625599
    L 502.7899121102188,578.7299146048944
    L 502.7899121102188,482.1992374485551
    L 506.7033179408812,482.1992374485551
    L 506.7033179408812,578.7299146048944
    Z
  " fill="rgba(255, 255, 255, 0.6)" stroke="rgb(132, 0, 0)" stroke-width="0.362352391728px"/><text class="net-label-text" x="504.74661502555" y="578.0776802997839" fill="rgb(132, 0, 0)" text-anchor="start" dominant-baseline="central" font-family="sans-serif" font-variant-numeric="tabular-nums" font-size="3.2611715255519997px" transform="rotate(-90 504.74661502555 578.0776802997839)">PWRCTRL1_J1_pin1/PWRCTRL1_R1_pin1/PWRCTRL1_C1_pin1</text><path class="net-label" d="
    M 779.0020815146801,110.46191877479998
    L 778.0237300570145,112.41862169013119
    L 681.4930529006753,112.41862169013118
    L 681.4930529006753,108.50521585946878
    L 778.0237300570145,108.50521585946878
    Z
  " fill="rgba(255, 255, 255, 0.6)" stroke="rgb(132, 0, 0)" stroke-width="0.362352391728px"/><text class="net-label-text" x="777.371495751904" y="110.46191877479998" fill="rgb(132, 0, 0)" text-anchor="end" dominant-baseline="central" font-family="sans-serif" font-variant-numeric="tabular-nums" font-size="3.2611715255519997px" transform="">PWRCTRL1_J1_pin1/PWRCTRL1_R1_pin1/PWRCTRL1_C1_pin1</text><path class="net-label" d="
    M 621.650555406796,110.46191877479998
    L 619.6938524914648,109.48356731713439
    L 619.6938524914648,9.058809791024956
    L 623.6072583221272,9.058809791024956
    L 623.6072583221272,109.48356731713439
    Z
  " fill="rgba(255, 255, 255, 0.6)" stroke="rgb(132, 0, 0)" stroke-width="0.362352391728px"/><text class="net-label-text" x="621.650555406796" y="108.83133301202399" fill="rgb(132, 0, 0)" text-anchor="start" dominant-baseline="central" font-family="sans-serif" font-variant-numeric="tabular-nums" font-size="3.2611715255519997px" transform="rotate(-90 621.650555406796 108.83133301202399)">PWRCTRL1_J1_pin2/PWRCTRL1_LED1_pin2/PWRCTRL1_C1_pin2</text><path class="net-label" d="
    M 473.72019148384,583.3317899798399
    L 474.6985429415056,581.3750870645086
    L 575.123300467615,581.3750870645086
    L 575.123300467615,585.2884928951711
    L 474.6985429415056,585.2884928951711
    Z
  " fill="rgba(255, 255, 255, 0.6)" stroke="rgb(132, 0, 0)" stroke-width="0.362352391728px"/><text class="net-label-text" x="475.35077724661596" y="583.3317899798399" fill="rgb(132, 0, 0)" text-anchor="start" dominant-baseline="central" font-family="sans-serif" font-variant-numeric="tabular-nums" font-size="3.2611715255519997px" transform="">PWRCTRL1_J1_pin2/PWRCTRL1_LED1_pin2/PWRCTRL1_C1_pin2</text><path class="net-label" d="
    M 621.378791113,291.63811463879995
    L 623.3354940283313,292.61646609646556
    L 623.3354940283313,361.57212624230397
    L 619.4220881976688,361.57212624230397
    L 619.4220881976688,292.61646609646556
    Z
  " fill="rgba(255, 255, 255, 0.6)" stroke="rgb(132, 0, 0)" stroke-width="0.362352391728px"/><text class="net-label-text" x="621.378791113" y="293.2687004015759" fill="rgb(132, 0, 0)" text-anchor="start" dominant-baseline="central" font-family="sans-serif" font-variant-numeric="tabular-nums" font-size="3.2611715255519997px" transform="rotate(90 621.378791113 293.2687004015759)">PWRCTRL1_R1_pin2/PWRCTRL1_LED1_pin1</text></svg>