Added usb_Ax1 and potentiometer.

This commit is contained in:
Martin Budden 2020-02-25 20:39:37 +00:00
parent 598527edbe
commit 1af2e18594
2 changed files with 60 additions and 29 deletions

View File

@ -25,7 +25,7 @@ include <../vitamins/d_connectors.scad>
test_pcb = ["TestPCB", "Test PCB",
40, 420, 1.6, // length, width, thickness
40, 480, 1.6, // length, width, thickness
3, // Corner radius
2.75, // Mounting hole diameter
6, // Pad around mounting hole
@ -42,30 +42,32 @@ test_pcb = ["TestPCB", "Test PCB",
[ 20, 30, 0, "2p54socket", 3, 1, undef, undef, undef, "red" ],
[ 10, 40, 0, "chip", 5, 10, 1, grey20], // E2 stop
[ 10, 60, 0, "rj45"],
[ 10, 80, 0, "usb_Ax2"],
[ 10, 100, 0, "usb_uA"],
[ 10, 120, 0, "usb_B"],
[ 10, 140, 0, "buzzer"],
[ 10, 155, 0, "jack"],
[ 10, 165, 0, "barrel_jack"],
[ 10, 180, 0, "hdmi"],
[ 10, 200, 0, "mini_hdmi"],
[ 10, 210, 0, "flex"],
[ 10, 225, 0, "flat_flex"],
[ 10, 240, 0, "D_plug", DCONN9],
[ 10, 255, 0, "molex_hdr", 2],
[ 10, 265, 0, "jst_xh", 2],
[ 10, 275, 0, "term254", 3],
[ 10, 290, 0, "gterm35", 4],
[ 10, 310, 0, "gterm635", 2],
[ 10, 330, 0, "term35", 4],
[ 10, 345, 0, "transition", 5],
[ 10, 355, 0, "block", 10,5, 8],
[ 10, 365, 0, "button_6mm"],
[ 10, 375, 0, "microswitch", small_microswitch],
//[ 10, 360, 0, "pcb"],
[ 10, 390, 0, "standoff", 5, 4.5, 12.5, 2.54],
[ 10, 400, 0, "uSD", [12, 11.5, 1.4]],
[ 10, 80, 0, "usb_A"],
[ 10, 100, 0, "usb_Ax2"],
[ 10, 120, 0, "usb_uA"],
[ 10, 140, 0, "usb_B"],
[ 10, 160, 0, "buzzer"],
[ 10, 175, 0, "potentiometer"],
[ 10, 190, 0, "jack"],
[ 10, 200, 0, "barrel_jack"],
[ 10, 220, 0, "hdmi"],
[ 10, 240, 0, "mini_hdmi"],
[ 10, 250, 0, "flex"],
[ 10, 265, 0, "flat_flex"],
[ 10, 280, 0, "D_plug", DCONN9],
[ 10, 300, 0, "molex_hdr", 2],
[ 10, 310, 0, "jst_xh", 2],
[ 10, 320, 0, "term254", 3],
[ 10, 340, 0, "gterm35", 4],
[ 10, 360, 0, "gterm635", 2],
[ 10, 380, 0, "term35", 4],
[ 10, 400, 0, "transition", 5],
[ 10, 410, 0, "block", 10,5, 8],
[ 10, 420, 0, "button_6mm"],
[ 10, 435, 0, "microswitch", small_microswitch],
//[ 10, 440, 0, "pcb"],
[ 10, 450, 0, "standoff", 5, 4.5, 12.5, 2.54],
[ 10, 460, 0, "uSD", [12, 11.5, 1.4]],
],
// accesories
[]

View File

@ -31,6 +31,7 @@ include <microswitches.scad>
use <../utils/rounded_cylinder.scad>
use <../utils/dogbones.scad>
use <../utils/thread.scad>
use <../utils/tube.scad>
use <d_connector.scad>
@ -79,16 +80,21 @@ module chip(length, width, thickness, colour, cutout = false) //! Draw a coloure
color(colour)
translate_z(thickness / 2) cube([length, width, thickness], center = true);
module usb_Ax1(cutout = false) { //! Draw USB type A single socket
usb_A(h = 6.5, v_flange_l = 4.5, bar = 0, cutout = cutout);
}
module usb_Ax2(cutout = false) { //! Draw USB type A dual socket
usb_A(h = 15.6, v_flange_l = 12.15, bar = 3.4, cutout = cutout);
}
module usb_A(h, v_flange_l, bar, cutout) {
l = 17;
w = 13.25;
h = 15.6;
flange_t = 0.4;
h_flange_h = 0.8;
h_flange_l = 11;
v_flange_h = 1;
v_flange_l = 12.15;
bar = 3.4;
socket_h = (h - 2 * flange_t - bar) / 2;
translate_z(h / 2)
@ -203,11 +209,32 @@ module jack(cutout = false) { //! Draw 3.5mm jack
module buzzer(height, diameter, colour) { //! Draw PCB buzzer with specified height, diameter and color
color (colour)
tube(or = diameter / 2, ir = height > 5 ? 1 : 0.75, h = height);
tube(or = diameter / 2, ir = height > 5 ? 1 : 0.75, h = height, center = false);
color("white")
cylinder(d = 2, h = max(height - 3 , 0.5));
}
module potentiometer(h1, h2) {
color("silver") {
baseSize = [12, 11, 6];
translate_z(baseSize.z / 2)
cube(baseSize, center = true);
translate_z(baseSize.z) {
cylinder(d = 5, h = h1 - 0.5);
if (show_threads)
male_metric_thread(6, metric_coarse_pitch(5), length = h1 - 0.5, center = false);
}
translate_z(baseSize.z + h1 - 0.5)
cylinder(d = 3, h = 0.5);
translate_z(baseSize.z + h1)
linear_extrude(h2)
difference() {
circle(d=5);
square([0.75,5], center = true);
}
}
}
function hdmi_depth(type) = type[2]; //! Front to back depth
function hdmi_width1(type) = type[3]; //! Inside width at the top
function hdmi_width2(type) = type[4]; //! Inside width at the bottom
@ -715,10 +742,12 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(show(comp, "2p54socket")) pin_socket(2p54header, comp[4], comp[5], param(6, false), param(7), param(8, false), cutouts, param(9, undef));
if(show(comp, "chip")) chip(comp[4], comp[5], comp[6], param(7, grey30), cutouts);
if(show(comp, "rj45")) rj45(cutouts);
if(show(comp, "usb_A")) usb_Ax1(cutouts);
if(show(comp, "usb_Ax2")) usb_Ax2(cutouts);
if(show(comp, "usb_uA")) usb_uA(cutouts);
if(show(comp, "usb_B")) usb_B(cutouts);
if(show(comp, "buzzer")) buzzer(param(4, 9), param(5, 12), param(6, grey20));
if(show(comp, "potentiometer")) potentiometer(param(4, 5), param(5, 9));
if(show(comp, "jack")) jack(cutouts);
if(show(comp, "barrel_jack")) barrel_jack(cutouts);
if(show(comp, "hdmi")) hdmi(hdmi_full, cutouts);