rushabhcodes/Attiny85-Arcade-Keychain

This code defines the hardware layout of an ATtiny85-based arcade-style gamepad keychain, featuring a custom PCB with power management, an OLED display, push buttons, an oscillator, a piezo transducer driven via a inverter, mechanical mounting holes, and silkscreen graphics, all modeled with detailed component footprints and electrical traces.

Version
1.0.4
License
unset
Stars
2

dist/index.js

import { jsx, jsxs } from 'react/jsx-runtime';
import coinCellHolder3003Step from '././assets/CoinCellHolder3003-1b675890.step';

// Board geometry extracted from the reference Gerbers
// (Attiny-Arcade_Keychain_2.0.GKO, Altium 4:4 metric) and re-expressed
// relative to the board centre at (176.848 mm, -59.9235 mm).
//
// Board bounding box: 97.802 mm x 42.195 mm
/** Gamepad-shaped board outline, counter-clockwise, 128 points. */
const BOARD_OUTLINE = [
    { x: -47.8486, y: -4.1405 },
    { x: -48.3728, y: -5.5127 },
    { x: -48.7255, y: -6.9388 },
    { x: -48.9012, y: -8.3972 },
    { x: -48.8974, y: -9.8662 },
    { x: -48.7142, y: -11.3237 },
    { x: -48.3543, y: -12.7479 },
    { x: -47.823, y: -14.1174 },
    { x: -47.1284, y: -15.4118 },
    { x: -46.2809, y: -16.6116 },
    { x: -45.2931, y: -17.6988 },
    { x: -44.1799, y: -18.6573 },
    { x: -42.9578, y: -19.4725 },
    { x: -41.6454, y: -20.1323 },
    { x: -40.2621, y: -20.6268 },
    { x: -38.8289, y: -20.9486 },
    { x: -37.367, y: -21.0928 },
    { x: -36.6322, y: -21.0976 },
    { x: -35.1685, y: -20.9723 },
    { x: -33.7312, y: -20.6691 },
    { x: -32.3417, y: -20.1926 },
    { x: -31.0208, y: -19.5498 },
    { x: -19.6902, y: -13.0145 },
    { x: -19.0085, y: -12.7716 },
    { x: -18.2884, y: -12.6991 },
    { x: -17.927, y: -12.7284 },
    { x: -17.3982, y: -12.8534 },
    { x: -16.9006, y: -13.0718 },
    { x: -16.4506, y: -13.3763 },
    { x: -16.0629, y: -13.757 },
    { x: -15.7502, y: -14.2014 },
    { x: -15.5228, y: -14.695 },
    { x: -15.2518, y: -15.6916 },
    { x: -14.9279, y: -16.2099 },
    { x: -14.6632, y: -16.465 },
    { x: -14.2464, y: -16.7218 },
    { x: -13.7797, y: -16.8697 },
    { x: -13.4136, y: -16.9034 },
    { x: 13.6584, y: -16.8884 },
    { x: 14.0176, y: -16.81 },
    { x: 14.3563, y: -16.6673 },
    { x: 14.6632, y: -16.465 },
    { x: 15.0052, y: -16.1146 },
    { x: 15.2966, y: -15.5774 },
    { x: 15.4673, y: -14.8676 },
    { x: 15.6645, y: -14.3612 },
    { x: 15.9497, y: -13.8987 },
    { x: 16.4506, y: -13.3763 },
    { x: 16.9006, y: -13.0717 },
    { x: 17.5719, y: -12.8011 },
    { x: 18.1073, y: -12.7082 },
    { x: 18.8304, y: -12.7371 },
    { x: 19.3567, y: -12.8723 },
    { x: 19.85, y: -13.1003 },
    { x: 31.0208, y: -19.5498 },
    { x: 32.3417, y: -20.1925 },
    { x: 33.7312, y: -20.6691 },
    { x: 35.1686, y: -20.9722 },
    { x: 36.6322, y: -21.0975 },
    { x: 37.367, y: -21.0928 },
    { x: 38.8289, y: -20.9485 },
    { x: 40.2622, y: -20.6267 },
    { x: 40.9614, y: -20.4007 },
    { x: 42.3118, y: -19.8225 },
    { x: 42.9579, y: -19.4725 },
    { x: 44.1799, y: -18.6572 },
    { x: 44.7512, y: -18.1951 },
    { x: 45.8037, y: -17.1703 },
    { x: 46.7231, y: -16.0246 },
    { x: 47.1285, y: -15.4118 },
    { x: 47.8231, y: -14.1174 },
    { x: 48.1097, y: -13.4407 },
    { x: 48.5561, y: -12.0413 },
    { x: 48.7143, y: -11.3236 },
    { x: 48.8975, y: -9.8661 },
    { x: 48.9013, y: -8.3972 },
    { x: 48.7255, y: -6.9387 },
    { x: 48.3729, y: -5.5127 },
    { x: 48.1318, y: -4.8186 },
    { x: 47.6402, y: -3.6852 },
    { x: 45.9408, y: -0.2252 },
    { x: 44.2811, y: 2.7812 },
    { x: 42.8971, y: 5.0586 },
    { x: 41.4301, y: 7.2835 },
    { x: 39.9916, y: 9.3077 },
    { x: 38.1824, y: 11.6742 },
    { x: 36.3004, y: 13.972 },
    { x: 32.9797, y: 17.77 },
    { x: 32.1271, y: 18.6137 },
    { x: 31.1796, y: 19.3493 },
    { x: 30.6744, y: 19.6731 },
    { x: 29.6105, y: 20.2271 },
    { x: 29.0556, y: 20.4553 },
    { x: 27.9097, y: 20.8098 },
    { x: 27.3228, y: 20.935 },
    { x: 26.132, y: 21.0786 },
    { x: 7.3137, y: 21.0925 },
    { x: 6.8125, y: 20.9951 },
    { x: 6.2472, y: 20.7008 },
    { x: 5.88, y: 20.3461 },
    { x: 5.4374, y: 19.7497 },
    { x: 4.9387, y: 19.353 },
    { x: 4.4653, y: 19.1618 },
    { x: 3.9589, y: 19.0966 },
    { x: -3.9589, y: 19.0966 },
    { x: -4.3405, y: 19.1333 },
    { x: -4.8252, y: 19.2939 },
    { x: -5.2534, y: 19.572 },
    { x: -5.5205, y: 19.847 },
    { x: -5.963, y: 20.4434 },
    { x: -6.3523, y: 20.7739 },
    { x: -6.8125, y: 20.995 },
    { x: -7.3137, y: 21.0924 },
    { x: -25.5322, y: 21.0966 },
    { x: -26.7296, y: 21.0247 },
    { x: -27.3228, y: 20.935 },
    { x: -28.488, y: 20.6498 },
    { x: -29.6105, y: 20.2272 },
    { x: -30.6745, y: 19.6731 },
    { x: -31.6644, y: 18.9957 },
    { x: -32.5661, y: 18.2047 },
    { x: -35.8168, y: 14.5415 },
    { x: -38.5475, y: 11.2107 },
    { x: -39.9916, y: 9.3077 },
    { x: -41.43, y: 7.2835 },
    { x: -42.897, y: 5.0586 },
    { x: -44.2811, y: 2.7812 },
    { x: -46.2277, y: -0.78 },
];
/** Centre of the triangular keychain cut-out in the upper-left grip. */
const KEYCHAIN_CUTOUT_CENTER = { x: -28.8259, y: 15.4395 };
/** Triangular keychain cut-out, relative to KEYCHAIN_CUTOUT_CENTER. */
const KEYCHAIN_CUTOUT = [
    { x: 1.1563, y: -3.3395 },
    { x: 1.4136, y: -3.4327 },
    { x: 1.7749, y: -3.4816 },
    { x: 2.1372, y: -3.4418 },
    { x: 2.4792, y: -3.3159 },
    { x: 2.7808, y: -3.1111 },
    { x: 3.0241, y: -2.8397 },
    { x: 3.1947, y: -2.5176 },
    { x: 3.2826, y: -2.1639 },
    { x: 3.2937, y: 1.9816 },
    { x: 3.2506, y: 2.3389 },
    { x: 3.0795, y: 2.7542 },
    { x: 2.793, y: 3.1003 },
    { x: 2.417, y: 3.346 },
    { x: 1.985, y: 3.4693 },
    { x: 1.4476, y: 3.4411 },
    { x: 0.5207, y: 3.161 },
    { x: -0.3656, y: 2.771 },
    { x: -1.1983, y: 2.2768 },
    { x: -1.9652, y: 1.6855 },
    { x: -2.655, y: 1.006 },
    { x: -3.1163, y: 0.4104 },
    { x: -3.281, y: -0.1019 },
    { x: -3.2848, y: -0.4618 },
    { x: -3.1693, y: -0.8959 },
    { x: -2.9871, y: -1.2062 },
    { x: -2.6645, y: -1.5188 },
];

const pinLabels$4 = {
    pin1: ["pin1"],
    pin2: ["pin2"],
    pin3: ["pin3"],
    pin4: ["GND"],
    pin5: ["pin5"],
    pin6: ["pin6"],
    pin7: ["pin7"],
    pin8: ["VCC"],
};
const ATTINY85_20PU = (props) => {
    return (jsx("chip", { pinLabels: pinLabels$4, supplierPartNumbers: {
            jlcpcb: ["C965497"],
        }, manufacturerPartNumber: "ATTINY85_20PU", footprint: jsxs("footprint", { children: [jsx("platedhole", { portHints: ["pin1"], pcbX: "-3.81mm", pcbY: "-3.949954mm", holeWidth: "0.9000236mm", holeHeight: "1.3760196mm", outerWidth: "1.524mm", outerHeight: "1.999996mm", shape: "pill" }), jsx("platedhole", { portHints: ["pin8"], pcbX: "-3.81mm", pcbY: "3.949954mm", holeWidth: "0.9000236mm", holeHeight: "1.3760196mm", outerWidth: "1.524mm", outerHeight: "1.999996mm", shape: "pill" }), jsx("platedhole", { portHints: ["pin2"], pcbX: "-1.27mm", pcbY: "-3.949954mm", holeWidth: "0.9000236mm", holeHeight: "1.3760196mm", outerWidth: "1.524mm", outerHeight: "1.999996mm", shape: "pill" }), jsx("platedhole", { portHints: ["pin7"], pcbX: "-1.27mm", pcbY: "3.949954mm", holeWidth: "0.9000236mm", holeHeight: "1.3760196mm", outerWidth: "1.524mm", outerHeight: "1.999996mm", shape: "pill" }), jsx("platedhole", { portHints: ["pin3"], pcbX: "1.27mm", pcbY: "-3.949954mm", holeWidth: "0.9000236mm", holeHeight: "1.3760196mm", outerWidth: "1.524mm", outerHeight: "1.999996mm", shape: "pill" }), jsx("platedhole", { portHints: ["pin6"], pcbX: "1.27mm", pcbY: "3.949954mm", holeWidth: "0.9000236mm", holeHeight: "1.3760196mm", outerWidth: "1.524mm", outerHeight: "1.999996mm", shape: "pill" }), jsx("platedhole", { portHints: ["pin4"], pcbX: "3.81mm", pcbY: "-3.949954mm", holeWidth: "0.9000236mm", holeHeight: "1.3760196mm", outerWidth: "1.524mm", outerHeight: "1.999996mm", shape: "pill" }), jsx("platedhole", { portHints: ["pin5"], pcbX: "3.81mm", pcbY: "3.949954mm", holeWidth: "0.9000236mm", holeHeight: "1.3760196mm", outerWidth: "1.524mm", outerHeight: "1.999996mm", shape: "pill" }), jsx("silkscreenpath", { route: [
                        { x: -4.726178000000004, y: -0.7999984000000211 },
                        { x: -4.726178000000004, y: -2.721406800000011 },
                        { x: 4.726203400000003, y: -2.721406800000011 },
                        { x: 4.726203400000003, y: 2.7213813999999843 },
                        { x: -4.726178000000004, y: 2.7213813999999843 },
                        { x: -4.726178000000004, y: 0.7999983999999927 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -4.726190699999989, y: -0.7999984000000211 },
                        { x: -4.726190699999989, y: 0.7999983999999927 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -5.102351999999996, y: -3.8023799999999994 },
                        { x: -5.107467010512437, y: -3.841232362136523 },
                        { x: -5.122463462536288, y: -3.8774370000000147 },
                        { x: -5.146319372648961, y: -3.9085266273510513 },
                        { x: -5.177408999999983, y: -3.932382537463724 },
                        { x: -5.213613637863489, y: -3.947378989487561 },
                        { x: -5.252465999999984, y: -3.9524940000000157 },
                        { x: -5.291318362136508, y: -3.947378989487561 },
                        { x: -5.327522999999999, y: -3.932382537463724 },
                        { x: -5.358612627351022, y: -3.9085266273510513 },
                        { x: -5.382468537463694, y: -3.8774370000000147 },
                        { x: -5.3974649894875455, y: -3.841232362136523 },
                        { x: -5.402579999999986, y: -3.8023799999999994 },
                        { x: -5.3974649894875455, y: -3.763527637863504 },
                        { x: -5.382468537463694, y: -3.7273230000000126 },
                        { x: -5.358612627351022, y: -3.696233372648976 },
                        { x: -5.327522999999999, y: -3.6723774625363035 },
                        { x: -5.291318362136508, y: -3.6573810105124664 },
                        { x: -5.252465999999984, y: -3.6522660000000116 },
                        { x: -5.213613637863489, y: -3.6573810105124664 },
                        { x: -5.177408999999983, y: -3.6723774625363035 },
                        { x: -5.146319372648961, y: -3.696233372648976 },
                        { x: -5.122463462536288, y: -3.7273230000000126 },
                        { x: -5.107467010512437, y: -3.763527637863504 },
                        { x: -5.102351999999996, y: -3.8023799999999994 },
                    ] }), jsx("silkscreentext", { text: "{NAME}", pcbX: "-0.3429mm", pcbY: "5.3942mm", anchorAlignment: "center", fontSize: "1mm" }), jsx("courtyardoutline", { outline: [
                        { x: -5.660200000000003, y: 4.644199999999998 },
                        { x: 4.974400000000003, y: 4.644199999999998 },
                        { x: 4.974400000000003, y: -5.177600000000012 },
                        { x: -5.660200000000003, y: -5.177600000000012 },
                        { x: -5.660200000000003, y: 4.644199999999998 },
                    ] })] }), cadModel: {
            objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C965497.obj?uuid=49fc690c136d4479a04219fd9c039749",
            stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C965497.step?uuid=49fc690c136d4479a04219fd9c039749",
            pcbRotationOffset: 0,
            modelOriginPosition: {
                x: -12699999999199463e-21,
                y: 0,
                z: -1.0500059999999998,
            },
        }, ...props }));
};

const pinLabels$3 = {
    pin1: ["_POS"],
    pin2: ["_NEG"],
};
const PKLCS1212E2000_R1 = (props) => {
    return (jsx("chip", { pinLabels: pinLabels$3, symbol: jsxs("symbol", { children: [jsx("schematicpath", { points: [{ "x": -0.12, "y": 0.12 }, { "x": 0.2, "y": 0.12 }, { "x": 0.2, "y": -0.32 }, { "x": -0.12, "y": -0.32 }, { "x": -0.4, "y": -0.6 }, { "x": -0.4, "y": 0.4 }, { "x": -0.12, "y": 0.12 }], strokeColor: "#880000" }), jsx("port", { name: "pin1", pinNumber: 1, aliases: ["_POS"], direction: "right", schX: 0.6, schY: -0.2, schStemLength: 0.4 }), jsx("port", { name: "pin2", pinNumber: 2, aliases: ["_NEG"], direction: "right", schX: 0.6, schY: 0, schStemLength: 0.4 }), jsx("schematicpath", { points: [{ "x": 0.04, "y": -0.2 }, { "x": 0.16, "y": -0.2 }], strokeColor: "#880000" }), jsx("schematicpath", { points: [{ "x": 0.1, "y": -0.26 }, { "x": 0.1, "y": -0.14 }], strokeColor: "#880000" })] }), supplierPartNumbers: {
            jlcpcb: ["C184513"],
        }, manufacturerPartNumber: "PKLCS1212E2000_R1", footprint: "res_p11mm_pw3mm_ph4.5mm", cadModel: {
            objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C184513.obj?uuid=f7607a9699d849ec8f54e5e83abf494f",
            stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C184513.step?uuid=f7607a9699d849ec8f54e5e83abf494f",
            pcbRotationOffset: 0,
            modelOriginPosition: {
                x: -25399999913133797e-21,
                y: -5080000005364127e-20,
                z: 0,
            },
        }, ...props }));
};

const pinLabels$2 = {
    pin1: ["1A"],
    pin2: ["GND"],
    pin3: ["2A"],
    pin4: ["2Y"],
    pin5: ["VCC"],
    pin6: ["1Y"],
};
const SN74LVC2G04DBVR = (props) => {
    return (jsx("chip", { pinLabels: pinLabels$2, supplierPartNumbers: {
            jlcpcb: ["C10428"],
        }, manufacturerPartNumber: "SN74LVC2G04DBVR", footprint: "sot_h1.7434mm_pl1.1304mm_pin1location(rightside,bottom)", cadModel: {
            objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C10428.obj?uuid=229b69761e2c45dba6a83d8866dec72d",
            stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C10428.step?uuid=229b69761e2c45dba6a83d8866dec72d",
            pcbRotationOffset: 180,
            modelOriginPosition: {
                x: 0.000025399999913133797,
                y: -889000000370288e-19,
                z: -0.048939,
            },
        }, ...props }));
};

const pinLabels$1 = {
    pin1: ["NO"],
    pin2: ["COM"],
    pin3: ["NC"],
    pin4: ["mount1"],
    pin5: ["mount2"],
};
const SK_12D02VG3 = (props) => {
    const { name = "S1", ...restProps } = props;
    return (jsx("switch", { name: name, pinLabels: pinLabels$1, supplierPartNumbers: { jlcpcb: ["C131374"] }, manufacturerPartNumber: "SK-12D02VG3", footprint: jsxs("footprint", { children: [jsx("platedhole", { portHints: ["pin1"], pcbX: "-1.998599mm", pcbY: "0mm", holeWidth: "0.700024mm", holeHeight: "0.899922mm", outerWidth: "0.999998mm", outerHeight: "1.199896mm", pcbRotation: "90deg", shape: "pill" }), jsx("platedhole", { portHints: ["pin2"], pcbX: "0.000381mm", pcbY: "0mm", holeWidth: "0.700024mm", holeHeight: "0.899922mm", outerWidth: "0.999998mm", outerHeight: "1.199896mm", pcbRotation: "90deg", shape: "pill" }), jsx("platedhole", { portHints: ["pin3"], pcbX: "1.998853mm", pcbY: "0mm", holeWidth: "0.700024mm", holeHeight: "0.899922mm", outerWidth: "0.999998mm", outerHeight: "1.199896mm", pcbRotation: "90deg", shape: "pill" }), jsx("platedhole", { portHints: ["pin4"], pcbX: "4.099433mm", pcbY: "0mm", holeWidth: "0.700024mm", holeHeight: "1.5000224mm", outerWidth: "0.999998mm", outerHeight: "1.7999964mm", shape: "pill" }), jsx("platedhole", { portHints: ["pin5"], pcbX: "-4.099433mm", pcbY: "0mm", holeWidth: "0.700024mm", holeHeight: "1.5000224mm", outerWidth: "0.999998mm", outerHeight: "1.7999964mm", shape: "pill" }), jsx("silkscreenpath", { route: [
                        { x: -2.031619, y: -5.2500022 },
                        { x: 0.000381, y: -5.2500022 },
                        { x: 0.000381, y: -2.286 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -2.031619, y: -2.286 },
                        { x: -2.031619, y: -5.2500022 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -4.299585, y: 2.199894 },
                        { x: 4.300347, y: 2.199894 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -4.299585, y: -2.199894 },
                        { x: 4.300347, y: -2.199894 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 4.300347, y: 2.199894 },
                        { x: 4.300347, y: 1.1030458 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 4.300347, y: -1.1030458 },
                        { x: 4.300347, y: -2.199894 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -4.299585, y: 2.199894 },
                        { x: -4.299585, y: 1.1030458 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -4.299585, y: -1.1030458 },
                        { x: -4.299585, y: -2.199894 },
                    ] }), jsx("silkscreentext", { text: "{NAME}", pcbX: "-0.025019mm", pcbY: "3.3114mm", anchorAlignment: "center", fontSize: "1mm" }), jsx("courtyardoutline", { outline: [
                        { x: -4.669219, y: 2.5614 },
                        { x: 4.619181, y: 2.5614 },
                        { x: 4.619181, y: -5.5078 },
                        { x: -4.669219, y: -5.5078 },
                        { x: -4.669219, y: 2.5614 },
                    ] })] }), cadModel: {
            objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C131374.obj?uuid=5d97637519c4481c888d11820dbca974",
            stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C131374.step?uuid=5d97637519c4481c888d11820dbca974",
            pcbRotationOffset: 0,
            modelOriginPosition: {
                x: 0.00005,
                y: -99979e-7,
                z: -56e-7,
            },
        }, ...restProps }));
};

const pinLabels = {
    pin1: ["pin1"],
    pin2: ["pin2"]
};
const CPG135001D03 = (props) => {
    const { name = "SW1", ...restProps } = props;
    return (jsx("pushbutton", { name: name, pinLabels: pinLabels, supplierPartNumbers: {
            "jlcpcb": [
                "C400231"
            ]
        }, manufacturerPartNumber: "CPG135001D03", footprint: jsxs("footprint", { children: [jsx("hole", { pcbX: "-0.000127mm", pcbY: "-2.5249505mm", diameter: "3.5000184mm" }), jsx("hole", { pcbX: "-5.499989mm", pcbY: "-2.5249505mm", diameter: "1.999996mm" }), jsx("hole", { pcbX: "5.499989mm", pcbY: "-2.5249505mm", diameter: "1.999996mm" }), jsx("platedhole", { portHints: ["pin1"], pcbX: "-0.000127mm", pcbY: "3.3749615mm", outerDiameter: "1.7999964mm", holeDiameter: "1.1999976mm", shape: "circle" }), jsx("platedhole", { portHints: ["pin2"], pcbX: "4.999863mm", pcbY: "1.2751435mm", outerDiameter: "1.7999964mm", holeDiameter: "1.1999976mm", shape: "circle" }), jsx("silkscreenpath", { route: [{ "x": -7.500137400000085, "y": -10.024960899999769 }, { "x": 7.499883399999931, "y": -10.024960899999769 }] }), jsx("silkscreenpath", { route: [{ "x": 7.499883399999931, "y": -10.024960899999769 }, { "x": 7.499883399999931, "y": 4.975059900000019 }] }), jsx("silkscreenpath", { route: [{ "x": -7.500137400000085, "y": -10.024960899999769 }, { "x": -7.500137400000085, "y": 4.975059900000019 }] }), jsx("silkscreenpath", { route: [{ "x": -7.500137400000085, "y": 4.975059900000019 }, { "x": 7.499883399999931, "y": 4.975059900000019 }] }), jsx("silkscreentext", { text: "{NAME}", pcbX: "-0.000127mm", pcbY: "5.9934495mm", anchorAlignment: "center", fontSize: "1mm" }), jsx("courtyardoutline", { outline: [{ "x": -7.768527000000063, "y": 5.243449499999997 }, { "x": 7.768272999999908, "y": 5.243449499999997 }, { "x": 7.768272999999908, "y": -10.29335049999986 }, { "x": -7.768527000000063, "y": -10.29335049999986 }, { "x": -7.768527000000063, "y": 5.243449499999997 }] })] }), cadModel: {
            objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C400231.obj?uuid=f59fab8b336a4dedb49f39b3a4d43305",
            stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C400231.step?uuid=f59fab8b336a4dedb49f39b3a4d43305",
            pcbRotationOffset: 0,
            modelOriginPosition: { x: 0.00012700000002041634, y: 2.524975899999845, z: -3.000006 },
        }, ...restProps }));
};

const batteryPinLabels = {
    pin1: ["plus", "pos", "VBAT"],
    pin2: ["minus", "neg"],
};
const CoinCellHolder3003 = (props) => (jsx("chip", { ...props, pinLabels: batteryPinLabels, pinAttributes: { plus: { providesPower: true }, minus: { providesGround: true } }, footprint: jsxs("footprint", { children: [jsx("platedhole", { portHints: ["pin1"], shape: "oval", outerWidth: "2.775mm", outerHeight: "3mm", holeWidth: "1.85mm", holeHeight: "1.85mm", pcbX: -10.555, pcbY: 0 }), jsx("platedhole", { portHints: ["pin1"], shape: "oval", outerWidth: "2.775mm", outerHeight: "3mm", holeWidth: "1.85mm", holeHeight: "1.85mm", pcbX: 10.555, pcbY: 0 }), jsx("smtpad", { portHints: ["pin2"], shape: "circle", radius: "5mm", pcbX: 0, pcbY: 0 }), jsx("silkscreencircle", { radius: 10.2, pcbX: 0, pcbY: 0 })] }), 
    // Local STEP asset for the Keystone 3003-equivalent 20 mm retainer.
    cadModel: {
        stepUrl: coinCellHolder3003Step,
        // This STEP uses Y as its mounting/thickness axis, not Z.
        modelBoardNormalDirection: "y+",
        zOffsetFromSurface: "0.2mm",
    } }));

const oledPinLabels = {
    pin1: "GND",
    pin2: "VDD",
    pin3: ["SCK", "SCL"],
    pin4: "SDA",
};
const OledDisplay = (props) => (jsx("chip", { ...props, pinLabels: oledPinLabels, supplierPartNumbers: {
        jlcpcb: ["C5248080"],
    }, manufacturerPartNumber: "HS96L03W2C03", pinAttributes: { VDD: { requiresPower: true }, GND: { requiresGround: true } }, schWidth: 1.385, schPinArrangement: {
        leftSide: { pins: ["GND", "VDD", "SCK", "SDA"], direction: "top-to-bottom" },
    }, footprint: jsxs("footprint", { children: [jsx("platedhole", { portHints: ["pin1"], shape: "circle", holeDiameter: "1mm", outerDiameter: "2mm", pcbX: -3.81, pcbY: 0 }), jsx("platedhole", { portHints: ["pin2"], shape: "circle", holeDiameter: "1mm", outerDiameter: "2mm", pcbX: -1.27, pcbY: 0 }), jsx("platedhole", { portHints: ["pin3"], shape: "circle", holeDiameter: "1mm", outerDiameter: "2mm", pcbX: 1.27, pcbY: 0 }), jsx("platedhole", { portHints: ["pin4"], shape: "circle", holeDiameter: "1mm", outerDiameter: "2mm", pcbX: 3.81, pcbY: 0 }), jsx("silkscreenpath", { route: [
                    { x: -5.2, y: 1.5 },
                    { x: 5.2, y: 1.5 },
                    { x: 5.2, y: -1.5 },
                    { x: -5.2, y: -1.5 },
                    { x: -5.2, y: 1.5 },
                ] })] }), cadModel: {
        modelOriginPosition: {
            x: 0,
            y: 12,
            z: 0,
        },
        objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C5248080.obj?uuid=c6b423183c2f4cf5a163f75f8ad52fae",
        stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C5248080.step?uuid=c6b423183c2f4cf5a163f75f8ad52fae",
        pcbRotationOffset: 0,
    } }));

const tscircuitLogoSvg = `data:image/svg+xml,${encodeURIComponent(`
<svg
   viewBox="0 0 92 101"
   version="1.1"
   id="svg5"
   sodipodi:docname="tscircuit-logo.svg"
   inkscape:version="1.4.4 (dcaf3e7d9e, 2026-05-05)"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg">
  <defs
     id="defs5" />
  <sodipodi:namedview
     id="namedview5"
     pagecolor="#ffffff"
     bordercolor="#999999"
     borderopacity="1"
     inkscape:showpageshadow="2"
     inkscape:pageopacity="0"
     inkscape:pagecheckerboard="0"
     inkscape:deskcolor="#d1d1d1"
     inkscape:zoom="5.9018913"
     inkscape:cx="56.422592"
     inkscape:cy="51.932505"
     inkscape:window-width="1920"
     inkscape:window-height="1052"
     inkscape:window-x="0"
     inkscape:window-y="0"
     inkscape:window-maximized="1"
     inkscape:current-layer="svg5" />
  <path
     d="m 19.872307,100.852 -2.349,-0.154 -2.31,-0.459 -2.229,-0.757 -2.112,-1.042 -1.9580002,-1.308 -1.77,-1.552 -1.552,-1.77 -1.308,-1.958 -1.042,-2.112 -0.757,-2.229 -0.459,-2.31 -0.154,-2.349 v -38 l 0.154,-2.349 0.459,-2.31 0.757,-2.229 1.042,-2.112 1.308,-1.958 1.552,-1.77 1.77,-1.552 1.9580002,-1.308 2.112,-1.042 2.229,-0.757 2.31,-0.459 2.349,-0.154 h 42 l 2.349,0.154 2.31,0.459 2.229,0.757 2.112,1.042 1.958,1.308 1.77,1.552 1.552,1.77 1.308,1.958 1.042,2.112 0.757,2.229 0.459,2.31 0.154,2.349 v 38 l -0.154,2.349 -0.459,2.31 -0.757,2.229 -1.042,2.112 -1.308,1.958 -1.552,1.77 -1.77,1.552 -1.958,1.308 -2.112,1.042 -2.229,0.757 -2.31,0.459 -2.349,0.154 z"
     fill="#000000"
     id="path1" />
  <path
     d="m 12.372307,37.852 c 2.6943,0 4.3782,2.9167 3.0311,5.25 -0.6252,1.0829 -1.7807,1.75 -3.0311,1.75 -2.6943002,0 -4.3782002,-2.9167 -3.0311002,-5.25 0.6252,-1.0829 1.7807002,-1.75 3.0311002,-1.75 z"
     fill="#ffffff"
     id="path2" />
  <path
     d="m 29.297007,59.975 v 11.524 c 0,0.8026 0.1864,1.3903 0.559,1.763 0.4014,0.344 1.0607,0.516 1.978,0.516 h 2.795 v 5.074 h -3.784 c -5.074,0 -7.611,-2.4654 -7.611,-7.396 V 59.975 h -2.838 V 55.03 h 2.838 v -5.891 h 6.063 v 5.891 h 5.332 v 4.945 z m 18.7779,19.264 c -1.9493,0 -3.698,-0.344 -5.246,-1.032 -1.548,-0.7167 -2.7806,-1.677 -3.698,-2.881 -0.8886,-1.204 -1.376,-2.537 -1.462,-3.999 h 6.063 c 0.1147,0.9173 0.559,1.677 1.333,2.279 0.8027,0.602 1.7917,0.903 2.967,0.903 1.1467,0 2.0354,-0.2294 2.666,-0.688 0.6594,-0.4587 0.989,-1.0464 0.989,-1.763 0,-0.774 -0.4013,-1.3474 -1.204,-1.72 -0.774,-0.4014 -2.021,-0.8314 -3.741,-1.29 -1.7773,-0.43 -3.2393,-0.8744 -4.386,-1.333 -1.118,-0.4587 -2.0926,-1.161 -2.924,-2.107 -0.8026,-0.946 -1.204,-2.2217 -1.204,-3.827 0,-1.3187 0.3727,-2.5227 1.118,-3.612 0.774,-1.0894 1.8634,-1.9494 3.268,-2.58 1.4334,-0.6307 3.1104,-0.946 5.031,-0.946 2.838,0 5.1027,0.7166 6.794,2.15 1.6914,1.4046 2.623,3.311 2.795,5.719 h -5.762 c -0.086,-0.946 -0.4873,-1.6914 -1.204,-2.236 -0.688,-0.5734 -1.6196,-0.86 -2.795,-0.86 -1.0893,0 -1.935,0.2006 -2.537,0.602 -0.5733,0.4013 -0.86,0.9603 -0.86,1.677 0,0.8026 0.4014,1.419 1.204,1.849 0.8027,0.4013 2.0497,0.817 3.741,1.247 1.72,0.43 3.139,0.8743 4.257,1.333 1.118,0.4586 2.0784,1.1753 2.881,2.15 0.8314,0.946 1.2614,2.2073 1.29,3.784 0,1.376 -0.387,2.6086 -1.161,3.698 -0.7453,1.0893 -1.8346,1.9493 -3.268,2.58 -1.4046,0.602 -3.053,0.903 -4.945,0.903 z"
     fill="#ffffff"
     id="path3" />
  <path
     d="m 69.872307,22.352 4.5,2 7,-18.5 -7,-5 z"
     fill="#000000"
     stroke="#000000"
     id="path4" />
  <path
     d="m 78.658007,25.4493 0.5267,2.0892 9.3097,-5.3919 -0.0773,-4.0052 z"
     fill="#000000"
     stroke="#000000"
     id="path5" />
</svg>
  `)}`;
/**
 * The registry part ships generic pin1..pin8 labels. Re-label them so the
 * traces below can talk in PBn terms, and re-type the component so those
 * names are what the compiler checks the selectors against.
 */
const ATTINY85_PIN_LABELS = {
    pin1: ["PB5", "RESET"],
    pin2: ["PB3", "XTAL1"],
    pin3: ["PB4", "XTAL2"],
    pin4: "GND",
    pin5: ["PB0", "MOSI", "AREF"],
    pin6: ["PB1", "MISO", "OC0B"],
    pin7: ["PB2", "SCK", "INT0"],
    pin8: "VCC",
};
const Attiny85 = ATTINY85_20PU;
var index_circuit = () => (jsxs("board", { outline: BOARD_OUTLINE, layers: 2, thickness: "1.6mm", title: "ATtiny85 Arcade Keychain", minViaHoleDiameter: "0.3mm", minViaPadDiameter: "0.45mm", children: [jsx("schematicsection", { name: "Power", displayName: "Power" }), jsx("schematicsection", { name: "MCU", displayName: "ATtiny85" }), jsx("schematicsection", { name: "Display", displayName: "OLED" }), jsx("schematicsection", { name: "Buttons", displayName: "Buttons" }), jsx("schematicsection", { name: "Audio", displayName: "Audio" }), jsx(CoinCellHolder3003, { name: "BT1", schSectionName: "Power", schX: -20, schY: 5, layer: "bottom", pcbX: 0.0122, pcbY: -1.2397, doNotPlace: true }), jsx(SK_12D02VG3, { name: "S1", schSectionName: "Power", schX: -24, schY: 5, pcbX: -0.064, pcbY: 16.4735, pcbRotation: 180 }), jsx("capacitor", { name: "C1", capacitance: "100nF", footprint: "0805", schSectionName: "Power", schX: -24, schY: -1, schOrientation: "vertical", pcbX: 4.508, pcbY: -11.3235 }), jsx("capacitor", { name: "C2", capacitance: "100nF", footprint: "0805", schSectionName: "Power", schX: -20, schY: -1, schOrientation: "vertical", pcbX: -4.508, pcbY: -11.3235 }), jsx(Attiny85, { name: "IC1", pinLabels: ATTINY85_PIN_LABELS, schPinArrangement: {
                leftSide: {
                    pins: ["PB5", "PB3", "PB4", "GND"],
                    direction: "top-to-bottom",
                },
                rightSide: {
                    pins: ["VCC", "PB2", "PB1", "PB0"],
                    direction: "top-to-bottom",
                },
            }, schSectionName: "MCU", schX: -3, schY: 2, pcbX: 24.828, pcbY: 13.9495, pcbRotation: -90 }), jsx(OledDisplay, { name: "U1", schSectionName: "Display", schX: -11, schY: 2, pcbX: 0, pcbY: 11.5266 }), jsx("resistor", { name: "R1", resistance: "10k", footprint: "1206", schSectionName: "Buttons", schX: 6, schY: 5, schRotation: 90, pcbX: 14.922, pcbY: -7.6405 }), jsx(CPG135001D03, { name: "SW1", schSectionName: "Buttons", schX: 10, schY: 7, pcbX: 25, pcbY: -2.5 }), jsx("resistor", { name: "R2", resistance: "10k", footprint: "1206", schSectionName: "Buttons", schX: 6, schY: -1, schRotation: 90, pcbX: -14.2, pcbY: -7.5135 }), jsx(CPG135001D03, { name: "SW2", schSectionName: "Buttons", schX: 10, schY: 1, pcbX: -25, pcbY: -2.5 }), jsx(SN74LVC2G04DBVR, { name: "IC2", schPinArrangement: {
                leftSide: { pins: ["VCC", "1A", "2A"], direction: "top-to-bottom" },
                rightSide: { pins: ["GND", "1Y", "2Y"], direction: "top-to-bottom" },
            }, schSectionName: "Audio", schX: -6.06, schY: -9, pcbX: -0.084, pcbY: -10.3685, pcbRotation: 180 }), jsx(PKLCS1212E2000_R1, { name: "LS1", schSectionName: "Audio", schX: -0.21, schY: -10.27, pcbX: 0.063, pcbY: -1.2905 }), jsx("hole", { name: "MH1", diameter: "2.9mm", pcbX: -11.5, pcbY: 11.5 }), jsx("hole", { name: "MH2", diameter: "2.9mm", pcbX: 11.5, pcbY: 11.5 }), jsx("hole", { name: "MH3", diameter: "2.9mm", pcbX: -11.7, pcbY: -12.3 }), jsx("hole", { name: "MH4", diameter: "2.9mm", pcbX: 11.7, pcbY: -12.3 }), jsx("cutout", { shape: "polygon", points: KEYCHAIN_CUTOUT, pcbX: KEYCHAIN_CUTOUT_CENTER.x, pcbY: KEYCHAIN_CUTOUT_CENTER.y }), jsx("silkscreentext", { text: "ON", fontSize: 2.4, pcbX: -8.9, pcbY: 18.7 }), jsx("silkscreentext", { text: "OFF", fontSize: 2.4, pcbX: 8.9, pcbY: 18.7 }), jsx("silkscreengraphic", { imageUrl: tscircuitLogoSvg, width: "10mm", height: "10mm", pcbX: -19, pcbY: 15 }), jsx("silkscreentext", { text: "made by rushabhcodes", layer: "bottom", fontSize: 1.4, pcbX: 0, pcbY: -15 }), jsx("trace", { from: ".BT1 > .plus", to: ".S1 > .COM" }), jsx("trace", { from: ".BT1 > .minus", to: "net.GND" }), jsx("trace", { from: ".S1 > .NC", to: "net.V3" }), jsx("trace", { from: ".IC1 > .VCC", to: "net.V3" }), jsx("trace", { from: ".IC1 > .GND", to: "net.GND" }), jsx("trace", { from: ".IC2 > .VCC", to: "net.V3" }), jsx("trace", { from: ".IC2 > .GND", to: "net.GND" }), jsx("trace", { from: ".U1 > .VDD", to: "net.V3" }), jsx("trace", { from: ".U1 > .GND", to: "net.GND" }), jsx("trace", { from: ".C1 > .pin1", to: "net.V3" }), jsx("trace", { from: ".C1 > .pin2", to: "net.GND" }), jsx("trace", { from: ".C2 > .pin1", to: "net.V3" }), jsx("trace", { from: ".C2 > .pin2", to: "net.GND" }), jsx("trace", { from: ".IC1 > .PB3", to: ".U1 > .SDA" }), jsx("trace", { from: ".IC1 > .PB4", to: ".U1 > .SCK" }), jsx("trace", { from: ".SW1 > .pin1", to: "net.V3" }), jsx("trace", { from: ".SW1 > .pin2", to: ".IC1 > .PB2" }), jsx("trace", { from: ".R1 > .pin2", to: ".IC1 > .PB2" }), jsx("trace", { from: ".R1 > .pin1", to: "net.GND" }), jsx("trace", { from: ".SW2 > .pin1", to: "net.V3" }), jsx("trace", { from: ".SW2 > .pin2", to: ".IC1 > .PB0" }), jsx("trace", { from: ".R2 > .pin2", to: ".IC1 > .PB0" }), jsx("trace", { from: ".R2 > .pin1", to: "net.GND" }), jsx("trace", { from: ".IC1 > .PB1", to: ".IC2 > .1A" }), jsx("trace", { from: ".IC2 > .1Y", to: ".IC2 > .2A" }), jsx("trace", { from: ".IC2 > .1Y", to: ".LS1 > .pin2" }), jsx("trace", { from: ".IC2 > .2Y", to: ".LS1 > .pin1" }), jsx("copperpour", { connectsTo: "net.GND", layer: "top" }), jsx("copperpour", { connectsTo: "net.GND", layer: "bottom" })] }));

export { index_circuit as default };