aboutsummaryrefslogtreecommitdiff
path: root/3d-print/controller.scad
blob: 60062320460c0eda697850c4b4f6460b66caac08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
module label(string) {
     translate([0,0,1.2]) linear_extrude(3) text(string,size=4,halign="center");
}
 
module via() {
     cylinder(h=10,r=0.6,center=true,$fn=12);
}
 
module vias100mil(count) {
     for(i=[0 : count-1]) {
          translate([0,2.54*i,0]) via();
     }
}
 
module vias100milL(count,string,hf=-1.3,vf=-2) {
     vias100mil(count);
     translate([vf,hf+2.54*count/2,0]) rotate([0,0,90]) label(string);
}
 
// TTGO T7
module esp32() {
     for(x=[011011]) {
          translate([2.54*x,0,0]) vias100mil(10);
     }
     translate([14,15,0]) rotate([0,0,90]) label("esp");
}
 
// https://learn.adafruit.com/stereo-3-7w-class-d-audio-amplifier/assembly
module amp() {
     vias100milL(9,"amp",vf=-15);
}
 
module wire_pack() {
     for(x=[0 : 4]) {
          translate([0,4*x,0]) via();
     }
}
 
module resistors(value) {
     wire_pack();
     translate([10,0,0]) wire_pack();
     translate([7,10,0]) rotate([0,0,90]) label(value);
}
 
difference() {
     union() {
          cube([40,90,1.4]);
          // this is the support for the amp, must be moved together
          // with the amp vias below
          translate([12.5,70,0.8]) cube([15,10,3.5]);
     }
     translate([10,67.5,0]) rotate([0,0,-90]) amp();
 
     translate([6.25,8.5,0]) esp32();
     translate([11.5,-1.5,-1]) cube([17,15,3]);
 
     // rows
 
     // row output pins wired here
     // 220Ω between these
     // then to pins 3 of each qrd1114
     translate([5,36,0]) resistors("220Ω");
 
     // same output pins wired here
     // 10k0Ω between these
     // then to pins 1 of each qrd1114
     translate([25,36,0]) resistors("10kΩ");
 
     // columns: ouput pins directly to pins 2&4 of each qrd1114
 
     // connectors for the cable
     translate([5,57,0]) rotate([0,0,-90]) vias100milL(5,"led");
 
     translate([25,57,0]) rotate([0,0,-90]) vias100milL(5,"pht");
 
     translate([15,60,0]) rotate([0,0,-90]) vias100milL(5,"gnd");
 
}