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=[0, 1, 10, 11]) { 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"); }