diff --git a/src/fn/index.ts b/src/fn/index.ts index c3ee18a1..0b665c72 100644 --- a/src/fn/index.ts +++ b/src/fn/index.ts @@ -80,3 +80,5 @@ export { sot343 } from "./sot343" export { m2host } from "./m2host" export { mountedpcbmodule } from "./mountedpcbmodule" export { to92l } from "./to92l" +export { led5050 } from "./led5050" +export { led2835 } from "./led2835" diff --git a/src/fn/led2835.ts b/src/fn/led2835.ts new file mode 100644 index 00000000..2a8ace83 --- /dev/null +++ b/src/fn/led2835.ts @@ -0,0 +1,31 @@ +import type { AnySoupElement } from "circuit-json" +import { z } from "zod" +import { rectpad } from "../helpers/rectpad" +import { silkscreenRef } from "../helpers/silkscreenRef" + +export const led2835_def = z.object({ + fn: z.string().default("led2835"), +}) + +/** + * LED 2835 footprint (2.8mm x 3.5mm SMD LED) + * Common 2-pin white/single color LED package + */ +export const led2835 = ( + parameters: z.input, +): { circuitJson: AnySoupElement[]; parameters: any } => { + const pads: AnySoupElement[] = [] + + // 2835 LED: 2.8mm x 3.5mm body, 2 pads + const padWidth = 0.9 + const padHeight = 2.8 + const xOffset = 1.45 + + pads.push(rectpad(1, -xOffset, 0, padWidth, padHeight)) + pads.push(rectpad(2, xOffset, 0, padWidth, padHeight)) + + return { + circuitJson: [...pads, silkscreenRef(0, 2.2, 0.5)], + parameters, + } +} diff --git a/src/fn/led5050.ts b/src/fn/led5050.ts new file mode 100644 index 00000000..56597cc7 --- /dev/null +++ b/src/fn/led5050.ts @@ -0,0 +1,39 @@ +import type { AnySoupElement } from "circuit-json" +import { z } from "zod" +import { rectpad } from "../helpers/rectpad" +import { silkscreenRef } from "../helpers/silkscreenRef" + +export const led5050_def = z.object({ + fn: z.string().default("led5050"), +}) + +/** + * LED 5050 footprint (5.0mm x 5.0mm SMD RGB LED) + * Common 6-pin RGB LED package + */ +export const led5050 = ( + parameters: z.input, +): { circuitJson: AnySoupElement[]; parameters: any } => { + const pads: AnySoupElement[] = [] + + // 5050 LED: 5.0mm x 5.0mm body, 6 pads (3 each side) + const padWidth = 1.5 + const padHeight = 0.9 + const xOffset = 2.2 + const ySpacing = 1.6 + + // Left side pads (1, 2, 3) + pads.push(rectpad(1, -xOffset, ySpacing, padWidth, padHeight)) + pads.push(rectpad(2, -xOffset, 0, padWidth, padHeight)) + pads.push(rectpad(3, -xOffset, -ySpacing, padWidth, padHeight)) + + // Right side pads (4, 5, 6) + pads.push(rectpad(4, xOffset, -ySpacing, padWidth, padHeight)) + pads.push(rectpad(5, xOffset, 0, padWidth, padHeight)) + pads.push(rectpad(6, xOffset, ySpacing, padWidth, padHeight)) + + return { + circuitJson: [...pads, silkscreenRef(0, 3.5, 0.5)], + parameters, + } +}