diff --git a/lib.scad b/lib.scad index bcc26e9..43a4904 100644 --- a/lib.scad +++ b/lib.scad @@ -40,7 +40,6 @@ include include include include -include include include include diff --git a/libtest.png b/libtest.png index f01ce28..db0ed77 100644 Binary files a/libtest.png and b/libtest.png differ diff --git a/readme.md b/readme.md index 9f3f5a9..d69d539 100644 --- a/readme.md +++ b/readme.md @@ -1943,6 +1943,9 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o | 1 | ```d_plug(DCONN9, pcb = true)``` | D-type 9 way PCB mount plug | | 1 | ```hdmi(hdmi_full)``` | HDMI socket | | 1 | ```idc_transition(2p54header, 5)``` | IDC transition header 5 x 2 | +| 1 | ```led(LED10mm, "yellow")``` | LED 10 mm yellow | +| 1 | ```led(LED3mm)``` | LED 3 mm red | +| 1 | ```led(LED5mm, "orange")``` | LED 5 mm orange | | 1 | ```microswitch(small_microswitch)``` | Microswitch DM1-00P-110-3 | | 1 | ```hdmi(hdmi_mini)``` | Mini HDMI socket | | 1 | ```molex_254(2)``` | Molex KK header 2 way | diff --git a/tests/PCB.scad b/tests/PCB.scad index 0c4e647..0d73171 100644 --- a/tests/PCB.scad +++ b/tests/PCB.scad @@ -19,6 +19,7 @@ include <../core.scad> include <../vitamins/microswitches.scad> include <../vitamins/d_connectors.scad> +include <../vitamins/leds.scad> use <../vitamins/pcb.scad> @@ -63,10 +64,13 @@ test_pcb = ["TestPCB", "Test PCB", [ 10, 30, 0, "2p54socket", 6, 1], [ 25, 30, 0, "2p54socket", 4, 1, undef, undef, undef, "red" ], [ 10, 40, 0, "chip", 10, 5, 1, grey20], - [ 10, 60, 180, "rj45"], - [ 8, 80, 180, "usb_A"], - [ 8, 100, 180, "usb_Ax2"], - [ 3, 120, 180, "usb_uA"], + [ 5, 50, 0, "led", LED3mm, "red"], + [ 12, 50, 0, "led", LED5mm, "orange"], + [ 25, 50, 0, "led", LED10mm, "yellow"], + [ 10, 65, 180, "rj45"], + [ 8, 85, 180, "usb_A"], + [ 8, 105, 180, "usb_Ax2"], + [ 3, 125, 180, "usb_uA"], [ 8, 140, 180, "usb_B"], [ 5, 160, 0, "buzzer", 4.5, 8.5], [ 20, 160, 0, "buzzer"], diff --git a/tests/png/pcb.png b/tests/png/pcb.png index 23c1854..c520624 100644 Binary files a/tests/png/pcb.png and b/tests/png/pcb.png differ diff --git a/tests/png/pcbs.png b/tests/png/pcbs.png index f7434d6..e46d911 100644 Binary files a/tests/png/pcbs.png and b/tests/png/pcbs.png differ diff --git a/vitamins/led.scad b/vitamins/led.scad index 33c3559..2f171a6 100644 --- a/vitamins/led.scad +++ b/vitamins/led.scad @@ -49,7 +49,7 @@ module led(type, colour = "red", lead = 5) { //! Draw specified LED with desired } } color("silver") - for(side = [-1, 1], len = lead - side) + for(side = [-1, 1], len = lead - (lead < 3 ? 0 : side)) translate([side * led_pitch(type) / 2, 0, -len / 2]) vflip() cube([led_lead_t(type), led_lead_t(type), len], center = true); diff --git a/vitamins/pcb.scad b/vitamins/pcb.scad index 888cd81..f25b9d6 100644 --- a/vitamins/pcb.scad +++ b/vitamins/pcb.scad @@ -33,6 +33,7 @@ use <../utils/dogbones.scad> use <../utils/thread.scad> use <../utils/tube.scad> use +use function pcb_name(type) = type[1]; //! Description function pcb_length(type) = type[2]; //! Length @@ -821,6 +822,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon if(show(comp, "standoff")) if(!cutouts) standoff(comp[4], comp[5], comp[6], comp[7]); if(show(comp, "uSD")) uSD(comp[4], cutouts); if(show(comp, "trimpot10")) trimpot10(param(4, false), cutouts); + if(show(comp, "led")) led(comp[4], comp[5], 2.6); } } diff --git a/vitamins/pcbs.scad b/vitamins/pcbs.scad index 4eaa771..b8c5833 100644 --- a/vitamins/pcbs.scad +++ b/vitamins/pcbs.scad @@ -18,6 +18,8 @@ // include include +include + // // l w t r h l c b h // e i h a o a o o o @@ -324,7 +326,15 @@ PI_IO = ["PI_IO", "PI_IO V2", 35.56, 25.4, 1.6, 0, 0, 0, "green", tru ], []]; ZC_A0591 = ["ZC_A0591", "ZC-A0591 ULN2003 driver PCB", 35, 32, 1.6, 0, 2.5, 0, "green", false, [[2.25, 3.25], [-2.25, 3.25], [2.25, -3.25], [-2.25, -3.25] ], - [], [], [], [], M2p5_pan_screw]; + [ [ 12.25, 8.3, -90, "jst_xh", 5], + [ -6.5, 10, 0, "2p54header", 1, 4], + [-14, -4.5, 0, "2p54header", 4, 1], + [ 5.5, 6, 0, "led", LED3mm, [1,1,1, 0.5]], + [ 5.5, 10.5, 0, "led", LED3mm, [1,1,1, 0.5]], + [ 5.5, 15, 0, "led", LED3mm, [1,1,1, 0.5]], + [ 5.5, 19.5, 0, "led", LED3mm, [1,1,1, 0.5]], + + ], [], [], [], M2p5_pan_screw]; MT3608 = ["MT3608", "MT3608 boost converter module", 37, 17, 1.2, 2, 1.5, [5, 3], "#2140BE", false, [[3.0725, 5.095], [3.0725, -5.095], [-3.0725, 5.095], [-3.0725, -5.095]],