- Added first draft of housing
This commit is contained in:
@@ -61,6 +61,7 @@ add_executable(Firmware
|
||||
Easings.c
|
||||
UI_Control.c
|
||||
I2C_Master.c
|
||||
INA260.c
|
||||
|
||||
Display_Default_Configurations.c
|
||||
Display_Message_Box_Icons.c
|
||||
|
||||
@@ -9,19 +9,14 @@
|
||||
|
||||
// ============================================================================================
|
||||
// Includes
|
||||
#include "I2C_Master.h"
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
#define INA260_I2CADDR_DEFAULT 0x40 ///< INA260 default i2c address
|
||||
#define INA260_REG_CONFIG 0x00 ///< Configuration register
|
||||
#define INA260_REG_CURRENT 0x01 ///< Current measurement register (signed) in mA
|
||||
#define INA260_REG_BUSVOLTAGE 0x02 ///< Bus voltage measurement register in mV
|
||||
#define INA260_REG_POWER 0x03 ///< Power calculation register in mW
|
||||
#define INA260_REG_MASK_ENABLE 0x06 ///< Interrupt/Alert setting and checking register
|
||||
#define INA260_REG_ALERT_LIMIT 0x00 ///< Alert limit value register
|
||||
#define INA260_REG_MFG_UID 0xFE ///< Manufacturer ID Register
|
||||
#define INA260_REG_DIE_UID 0xFF ///< Die ID and Revision Register
|
||||
|
||||
#define UINT8_ARR_TO_UINT16(_U8_) ((uint16_t)(_U8_[0]) << 8) | (uint16_t)(_U8_[1])
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
@@ -91,6 +86,15 @@ void INA260_Init()
|
||||
|
||||
}
|
||||
|
||||
uint16_t INA260_Test_Read(uint8_t reg_address)
|
||||
{
|
||||
uint8_t Receive_Data[2];
|
||||
|
||||
I2CM_Packet_Receive(INA260_I2CADDR_DEFAULT, reg_address, 1, Receive_Data, 2);
|
||||
|
||||
return UINT8_ARR_TO_UINT16(Receive_Data);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Internal Functions
|
||||
|
||||
@@ -8,10 +8,21 @@
|
||||
|
||||
// ============================================================================================
|
||||
// Includes
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
#define INA260_REG_CONFIG 0x00 ///< Configuration register
|
||||
#define INA260_REG_CURRENT 0x01 ///< Current measurement register (signed) in mA
|
||||
#define INA260_REG_BUSVOLTAGE 0x02 ///< Bus voltage measurement register in mV
|
||||
#define INA260_REG_POWER 0x03 ///< Power calculation register in mW
|
||||
#define INA260_REG_MASK_ENABLE 0x06 ///< Interrupt/Alert setting and checking register
|
||||
#define INA260_REG_ALERT_LIMIT 0x00 ///< Alert limit value register
|
||||
#define INA260_REG_MFG_UID 0xFE ///< Manufacturer ID Register
|
||||
#define INA260_REG_DIE_UID 0xFF ///< Die ID and Revision Register
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
@@ -22,4 +33,6 @@
|
||||
// Function Declarations
|
||||
void INA260_Init();
|
||||
|
||||
uint16_t INA260_Test_Read(uint8_t reg_address);
|
||||
|
||||
#endif // INA260_H
|
||||
@@ -1 +1 @@
|
||||
6
|
||||
11
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include "pico/stdlib.h"
|
||||
|
||||
#include "INA260.h"
|
||||
#include "I2C_Master.h"
|
||||
#include "UI_Control.h"
|
||||
#include "Rotary_Encoder.h"
|
||||
@@ -89,6 +90,9 @@ int main(void)
|
||||
// I2C Master =============================================
|
||||
I2CM_Init(false);
|
||||
|
||||
// INA 260 =============================================
|
||||
INA260_Init();
|
||||
|
||||
// UI Control =================================================
|
||||
UI_Control_Init();
|
||||
|
||||
@@ -161,6 +165,12 @@ void Check_For_Serial_Input(void)
|
||||
USB_SERIAL_SEND_TERMINATOR();
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
USB_Serial_Send_Int_Hex(INA260_REG_MFG_UID, 2, true); USB_SERIAL_SEND_STRING(": "); USB_Serial_Send_Int_Hex(INA260_Test_Read(INA260_REG_MFG_UID), 4, true); USB_SERIAL_SEND_TERMINATOR();
|
||||
USB_Serial_Send_Int_Hex(INA260_REG_DIE_UID, 2, true); USB_SERIAL_SEND_STRING(": "); USB_Serial_Send_Int_Hex(INA260_Test_Read(INA260_REG_DIE_UID), 4, true); USB_SERIAL_SEND_TERMINATOR();
|
||||
USB_SERIAL_SEND_TERMINATOR();
|
||||
break;
|
||||
|
||||
default:
|
||||
USB_SERIAL_SEND_STRING("Unknown Command: ");
|
||||
USB_Serial_Put_Char(USB_Data);
|
||||
|
||||
BIN
Housing/FAD_Logo.stl
Normal file
BIN
Housing/FAD_Logo.stl
Normal file
Binary file not shown.
183
Housing/RP2350_MIDI_Lighter_Definition.scad
Normal file
183
Housing/RP2350_MIDI_Lighter_Definition.scad
Normal file
@@ -0,0 +1,183 @@
|
||||
PCB_T = 1.6;
|
||||
PCB_W = 58;
|
||||
PCB_H = 74;
|
||||
|
||||
eps = 0.001;
|
||||
|
||||
Cover_O = 2.5; // O = Overhang
|
||||
Cover_T_T = 2.0; // T_T = Top Thickness
|
||||
Cover_B_T = 3.0; // B_T = Bottom Thickness
|
||||
Wall_PCB_GAP = 0.25;
|
||||
|
||||
|
||||
Drill_M3 = 3.5;
|
||||
Ring_M3_H = 2;
|
||||
|
||||
Screw_Ring_M3_Outer_Diameter = 7.5;
|
||||
Screw_Ring_M3_Inner_Diameter = 5.5;
|
||||
|
||||
Spacer_Top_Height = 10;
|
||||
Spacer_Bot_Height = 5;
|
||||
|
||||
Wall_T_H = Spacer_Top_Height + PCB_T/2; // T_H = Wall Top Height
|
||||
Wall_B_H = Spacer_Bot_Height + PCB_T/2; // B_H = Wall Bottom Height
|
||||
|
||||
Mounting_Holes = [
|
||||
[ 4.0, 70.0, 0],
|
||||
[45.0, 70.0, 0],
|
||||
[42.0, 46.5, 0],
|
||||
[ 4.0, 21.0, 0],
|
||||
[48.0, 23.5, 0]
|
||||
];
|
||||
|
||||
Cable_Relief_Holder = [
|
||||
[10.5, 60.0, 0],
|
||||
[27.0, 60.0, 0]
|
||||
];
|
||||
|
||||
MIDI_Plugs = [
|
||||
[11.5, 13.335, 0],
|
||||
[46.5, 13.335, 0]
|
||||
];
|
||||
|
||||
SSD1306 = [15.875, 53.34 , 0];
|
||||
GC9A01A = [20.320, 20.32 , 0];
|
||||
Rotary_Encoder = [48.895, 36.830, 0];
|
||||
Power_Plug = [49.530, 64.770, 0];
|
||||
Button = [59.055, 23.495, 0];
|
||||
|
||||
|
||||
Screw_Area_Cutout_Widths = [
|
||||
9,
|
||||
12,
|
||||
9,
|
||||
9
|
||||
];
|
||||
|
||||
Screw_Area_Cutout_Offsets = [
|
||||
+Screw_Area_Cutout_Widths[0]/2 - Mounting_Holes[0][0] - Cover_O,
|
||||
-Screw_Area_Cutout_Widths[1]/2 + PCB_W - Mounting_Holes[1][0] + Cover_O,
|
||||
+Screw_Area_Cutout_Widths[2]/2 - Mounting_Holes[2][0] - Cover_O,
|
||||
-Screw_Area_Cutout_Widths[3]/2 + PCB_W - Mounting_Holes[3][0] + Cover_O
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
module Screw_Drill(drill)
|
||||
{
|
||||
translate([0,0,-50])
|
||||
cylinder(h=100, d=drill, center=false, $fn=100);
|
||||
}
|
||||
|
||||
module Screw_Ring_M3(height)
|
||||
{
|
||||
translate([0, 0, height/2])
|
||||
difference()
|
||||
{
|
||||
cylinder(h=1*height, d=Screw_Ring_M3_Outer_Diameter, center=true, $fn=100);
|
||||
cylinder(h=2*height, d=Screw_Ring_M3_Inner_Diameter, center=true, $fn=100);
|
||||
}
|
||||
}
|
||||
|
||||
module SSD1306_Cutout()
|
||||
{
|
||||
// Screw positions relative to the Display
|
||||
// See http://www.lcdwiki.com/File:MC096-015.jpg
|
||||
SSD1306_Screws = [
|
||||
[+27.3/2-2, 2 ,0],
|
||||
[-27.3/2+2, 2 ,0],
|
||||
[+27.3/2-2, 27.8-2 ,0],
|
||||
[-27.3/2+2, 27.8-2 ,0]
|
||||
];
|
||||
|
||||
mirror([0,1,0])
|
||||
translate([0,-2.54/2,0])
|
||||
{
|
||||
for (i = [0:3])
|
||||
{
|
||||
translate(SSD1306_Screws[i]) Screw_Drill(2.5);
|
||||
}
|
||||
|
||||
translate([0, 1.5 ,0]) cube([4*2.54 , 2.54 , 20], center=true);
|
||||
translate([0,14.27,0]) cube([27 , 20 , 20], center=true);
|
||||
translate([0,25.77-0.01,0]) cube([14 , 3 , 20], center=true);
|
||||
}
|
||||
}
|
||||
|
||||
module GC9A01A_Cutout(thickness)
|
||||
{
|
||||
Screw_Holes = [
|
||||
[+15, +06.2, 0],
|
||||
[-15, +06.2, 0],
|
||||
[+15, +36.2, 0],
|
||||
[-15, +36.2, 0]
|
||||
];
|
||||
|
||||
cube([20, 2, thickness], center=true);
|
||||
|
||||
hull()
|
||||
{
|
||||
translate([0, 21.1, 0])
|
||||
cylinder(d=36.0, h=thickness, center=true, $fn = $preview ? 32 : 100);
|
||||
|
||||
translate([0, 42.0, 0])
|
||||
cube([13, 0.1, thickness], center=true);
|
||||
}
|
||||
|
||||
for (i = Screw_Holes) {
|
||||
translate(i)
|
||||
cylinder(r=1.27, h=thickness, center=true, $fn = $preview ? 32 : 100);
|
||||
}
|
||||
}
|
||||
|
||||
module GC9A01A_Cover_Cutout(thickness)
|
||||
{
|
||||
Screw_Holes = [
|
||||
[+15, +06.2, 0],
|
||||
[-15, +06.2, 0],
|
||||
[+15, +36.2, 0],
|
||||
[-15, +36.2, 0]
|
||||
];
|
||||
|
||||
translate([0, 21.1, 0])
|
||||
cylinder(d=36.0, h=thickness, center=true, $fn = $preview ? 32 : 100);
|
||||
|
||||
for (i = Screw_Holes) {
|
||||
translate(i)
|
||||
cylinder(r=1.27, h=thickness, center=true, $fn = $preview ? 32 : 100);
|
||||
}
|
||||
}
|
||||
|
||||
module GC9A01A_Cover_Plate(thickness, scale_factor)
|
||||
{
|
||||
Circle_Cutout_D = Screw_Ring_M3_Outer_Diameter*1.1/scale_factor;
|
||||
|
||||
translate([0, 0, thickness/2])
|
||||
difference()
|
||||
{
|
||||
translate([ 0, 20.5, 0]) roundedBox([40*scale_factor, 44*scale_factor, thickness], 3, true, $fn = $preview ? 32 : 100);
|
||||
translate([22, 26, 0]) cylinder(d=Circle_Cutout_D, h=3*thickness, center=true, $fn = $preview ? 32 : 100);
|
||||
|
||||
translate([-16.5, 0.5, 0]) {
|
||||
cylinder(d=Circle_Cutout_D, h=3*thickness, center=true, $fn = $preview ? 32 : 100);
|
||||
translate([-Circle_Cutout_D/4, 0, 0]) cube([Circle_Cutout_D/2, Circle_Cutout_D, 3*thickness], center=true);
|
||||
translate([0, -Circle_Cutout_D/4, 0])cube([Circle_Cutout_D, Circle_Cutout_D/2, 3*thickness], center=true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module Screw_Area_Cutout(width, offset, thickness)
|
||||
{
|
||||
translate([offset, 0, thickness/2 + 0.1])
|
||||
cube([width, 5, thickness + 0.1], center=true);
|
||||
}
|
||||
|
||||
module Screw_Area_Stripe(offset, thickness, scale_y, scale_z)
|
||||
{
|
||||
Width = PCB_W + Cover_O + eps;
|
||||
|
||||
translate([PCB_W/2, offset, thickness/2 + 0.1])
|
||||
scale([1, scale_y, scale_z])
|
||||
cube([Width, 10, thickness + 0.1], center=true);
|
||||
}
|
||||
277
Housing/RP2350_MIDI_Lighter_Housing.scad
Normal file
277
Housing/RP2350_MIDI_Lighter_Housing.scad
Normal file
@@ -0,0 +1,277 @@
|
||||
use <MCAD/boxes.scad>
|
||||
use <MCAD/regular_shapes.scad>
|
||||
|
||||
include <RP2350_MIDI_Lighter_PCB.scad>
|
||||
include <RP2350_MIDI_Lighter_Definition.scad>
|
||||
|
||||
|
||||
Show_FAD_Logo = true;
|
||||
Show_PCB = false;
|
||||
$preview = false;
|
||||
Alternative = true;
|
||||
|
||||
// Info //
|
||||
// This version has the walls of the top part mostly associated to the to cover
|
||||
|
||||
|
||||
|
||||
if(Show_PCB)
|
||||
{
|
||||
PCB();
|
||||
translate([0,0,+PCB_T/2]) Spacer_Top();
|
||||
translate([0,0,-PCB_T/2]) Spacer_Bot();
|
||||
}
|
||||
|
||||
Top();
|
||||
|
||||
// Display_GC9A01A_Cover();
|
||||
|
||||
|
||||
// color([1.0, 0.4, 0.4]) Bottom(Alternative);
|
||||
// color([0.4, 0.4, 1.0]) Bottom_Wall(Alternative);
|
||||
|
||||
module Display_GC9A01A_Cover()
|
||||
{
|
||||
color([0.4, 1.0, 0.4], 1.5)
|
||||
translate([0, 0, +Spacer_Top_Height + PCB_T/2 + 5])
|
||||
translate(GC9A01A)
|
||||
difference() {
|
||||
GC9A01A_Cover_Plate(1, 1);
|
||||
GC9A01A_Cover_Cutout(10);
|
||||
}
|
||||
}
|
||||
|
||||
module Top()
|
||||
{
|
||||
difference()
|
||||
{
|
||||
translate([0, 0, +Spacer_Top_Height + PCB_T/2])
|
||||
union()
|
||||
{
|
||||
difference()
|
||||
{
|
||||
union()
|
||||
{
|
||||
Top_Plate();
|
||||
// Top_Wall();
|
||||
translate([0, 0, +Cover_T_T]) Screw_Rings_M3();
|
||||
// translate([0, 0, +Cover_T_T]) Relief_Rings_M3();
|
||||
}
|
||||
|
||||
Screw_Holes_M3();
|
||||
|
||||
for (i = [0:1]) {
|
||||
translate([0, 0, Cover_T_T/2])
|
||||
translate(MIDI_Plugs[i])
|
||||
scale([1, 1, 10]) MIDI_Plug_Cutout();
|
||||
}
|
||||
|
||||
translate(Rotary_Encoder) Screw_Drill(7.5);
|
||||
translate(GC9A01A) GC9A01A_Cutout(5*Cover_T_T);
|
||||
translate([0, 0, +Cover_T_T-0.5])
|
||||
translate(GC9A01A) GC9A01A_Cover_Plate(10, 1.01);
|
||||
}
|
||||
|
||||
for (i = [0:1]) {
|
||||
translate([0, 0, Cover_T_T]) translate(MIDI_Plugs[i]) MIDI_Plug_Arc();
|
||||
}
|
||||
|
||||
if(Show_FAD_Logo == true) {
|
||||
translate([PCB_W/2, 9.5, Cover_T_T])
|
||||
scale([0.02, 0.02, 2])
|
||||
intersection() {
|
||||
translate([0, 0, 0.5]) cube([500, 500, 1], center=true);
|
||||
import("FAD_Logo.stl", convexity=3, $fn = $preview ? 32 : 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PCB_Cutouts_Top();
|
||||
}
|
||||
}
|
||||
|
||||
module Top_Wall()
|
||||
{
|
||||
translate([PCB_W/2, PCB_H/2, -Wall_T_H/2])
|
||||
union()
|
||||
{
|
||||
difference()
|
||||
{
|
||||
roundedBox([PCB_W + 2*Cover_O, PCB_H + 2*Cover_O, 1*Wall_T_H], 2, true, $fn = $preview ? 32 : 100);
|
||||
roundedBox([PCB_W + 1*Cover_O, PCB_H + 1*Cover_O, 2*Wall_T_H], 2, true, $fn = $preview ? 32 : 100);
|
||||
}
|
||||
|
||||
// Internak Support Structures
|
||||
translate([+PCB_W/2+Cover_O/2, -13, 0]) translate([-5/2, 0, PCB_T/2]) cube([5, 2, Wall_T_H-PCB_T], center=true);
|
||||
translate([Cover_O/4, -PCB_H/2-Cover_O/2, 0]) translate([-1/2, 5/2, PCB_T/2]) cube([2, 5, Wall_T_H-PCB_T], center=true);
|
||||
}
|
||||
}
|
||||
|
||||
module Top_Plate()
|
||||
{
|
||||
translate([PCB_W/2, PCB_H/2, Cover_T_T/2])
|
||||
roundedBox([PCB_W + 2*Cover_O, PCB_H + 2*Cover_O, Cover_T_T], 2, true, $fn = $preview ? 32 : 100);
|
||||
}
|
||||
|
||||
module Bottom(Alternative)
|
||||
{
|
||||
translate([0, 0, -Spacer_Bot_Height - PCB_T/2])
|
||||
{
|
||||
difference()
|
||||
{
|
||||
translate([0, 0, -Cover_B_T])
|
||||
union()
|
||||
{
|
||||
Bottom_Plate(Alternative);
|
||||
|
||||
translate([0, 0, -1])
|
||||
for (i = [0:3]) {
|
||||
translate(Mounting_Holes[i]) cylinder(h=1, d=Screw_Ring_M3_Outer_Diameter, center=false, $fn = $preview ? 32 : 100);
|
||||
}
|
||||
|
||||
translate([0, 0, -1-Ring_M3_H]) Screw_Rings_M3();
|
||||
}
|
||||
|
||||
for (i = [0:3]) {
|
||||
// translate([0, 0, -Cover_B_T/2]) translate(Mounting_Holes[i])
|
||||
// scale(1.1) Screw_Area_Cutout(Screw_Area_Cutout_Widths[i], Screw_Area_Cutout_Offsets[i], Cover_B_T/2);
|
||||
|
||||
translate([0, 0, -Cover_B_T/2]) Screw_Area_Stripe(Mounting_Holes[i][1], Cover_B_T/2, 1.1, 1.5);
|
||||
}
|
||||
|
||||
Screw_Holes_M3();
|
||||
translate([0, PCB_H/2 + 4, 0]) Bottom_Zip_Cutout(PCB_W/3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module Bottom_Wall(Alternative)
|
||||
{
|
||||
Wall_H = Alternative == false ? Wall_B_H : Wall_B_H + Cover_B_T;
|
||||
|
||||
translate([PCB_W/2, PCB_H/2, -Wall_H/2])
|
||||
difference()
|
||||
{
|
||||
roundedBox([PCB_W + 2*Cover_O, PCB_H + 2*Cover_O, 1*Wall_H], 2, true, $fn = $preview ? 32 : 100);
|
||||
|
||||
translate([0, 0, Wall_B_H/2-0.001])
|
||||
cube([PCB_W + 1*Cover_O, PCB_H + 1*Cover_O, 1*Wall_B_H], center=true);
|
||||
|
||||
translate([0, 0, -Wall_B_H/2])
|
||||
cube([PCB_W - 0.0*Cover_O, PCB_H - 0.0*Cover_O, 1*Wall_B_H], center=true);
|
||||
}
|
||||
|
||||
translate([0, PCB_H/2 + 4, -Spacer_Bot_Height - PCB_T/2])
|
||||
Bottom_Zip_Guide(3);
|
||||
|
||||
translate([0, 0, -Wall_B_H])
|
||||
difference()
|
||||
{
|
||||
union()
|
||||
{
|
||||
for (i = [0:3]) {
|
||||
// translate([0, 0, -Cover_B_T/2]) translate(Mounting_Holes[i])
|
||||
// Screw_Area_Cutout(Screw_Area_Cutout_Widths[i], Screw_Area_Cutout_Offsets[i], Cover_B_T/2);
|
||||
translate([0, 0, -Cover_B_T/2]) Screw_Area_Stripe(Mounting_Holes[i][1], Cover_B_T/2, 1, 1);
|
||||
}
|
||||
}
|
||||
Screw_Holes_M3();
|
||||
}
|
||||
|
||||
// USB Cover
|
||||
translate([-3*Cover_O/4, 33, PCB_T/2]) cube([Cover_O/2, 9, PCB_T], center=true);
|
||||
|
||||
// Strip Cover at the front
|
||||
Relief_Wall_X = Cable_Relief_Holder[1][0] - Cable_Relief_Holder[0][0] + Screw_Ring_M3_Outer_Diameter-1;
|
||||
Relief_Wall_Z = 8.5;
|
||||
translate([Cable_Relief_Holder[0][0], PCB_H, 0])
|
||||
translate([Relief_Wall_X/2 - Screw_Ring_M3_Outer_Diameter/2 + 0.5, 3*Cover_O/4, Relief_Wall_Z/2]) cube([Relief_Wall_X, Cover_O/2, Relief_Wall_Z], center=true);
|
||||
|
||||
// Button Cover
|
||||
translate([PCB_W + 3*Cover_O/4, Button[1], PCB_T/2]) cube([Cover_O/2, 7, PCB_T], center=true);
|
||||
|
||||
// Power Plug Cover
|
||||
translate([PCB_W + 3*Cover_O/4, Power_Plug[1], PCB_T/2]) cube([Cover_O/2, 9, PCB_T], center=true);
|
||||
}
|
||||
|
||||
module Bottom_Plate(Alternative)
|
||||
{
|
||||
translate([PCB_W/2, PCB_H/2, Cover_B_T/2])
|
||||
if(Alternative == false)
|
||||
{
|
||||
roundedBox([PCB_W + 2*Cover_O, PCB_H + 2*Cover_O, Cover_B_T], 2, true, $fn = $preview ? 32 : 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
roundedBox([PCB_W - 0.25*Cover_O, PCB_H - 0.25*Cover_O, Cover_B_T], 1, true, $fn = $preview ? 32 : 100);
|
||||
}
|
||||
}
|
||||
|
||||
module Bottom_Zip_Guide(Cube_Height)
|
||||
{
|
||||
translate([PCB_W/2, 5, 0])
|
||||
{
|
||||
difference()
|
||||
{
|
||||
translate([0, -5, Cube_Height/2]) cube([PCB_W + 2*Cover_O, 10, Cube_Height], center=true);
|
||||
translate([0, -5, -1]) rotate([0, 90, 90]) oval_prism(12, 17.4, 3.5, center=true, $fn = $preview ? 32 : 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module Bottom_Zip_Cutout(Center_Offset)
|
||||
{
|
||||
Width = 3;
|
||||
Height = 10;
|
||||
|
||||
translate([PCB_W/2 - Center_Offset, 0, 0]) rotate([0,+45, 0]) cube([Width, Height, 100], center=true);
|
||||
translate([PCB_W/2 + Center_Offset, 0, 0]) rotate([0,-45, 0]) cube([Width, Height, 100], center=true);
|
||||
}
|
||||
|
||||
module MIDI_Plug_Cutout()
|
||||
{
|
||||
union()
|
||||
{
|
||||
translate([0, -10/2, 0]) cube([18.5, 10+0.0, 2*Cover_T_T], center=true);
|
||||
translate([0, -(10+10/2), 0]) cube([22.5, 10+0.1, 2*Cover_T_T], center=true);
|
||||
translate([0, 2/2, 0]) cube([11.0, 2+0.1, 2*Cover_T_T], center=true);
|
||||
translate([0, 4/2, 0]) cube([ 3.5, 2+0.1, 2*Cover_T_T], center=true);
|
||||
}
|
||||
}
|
||||
|
||||
module MIDI_Plug_Arc()
|
||||
{
|
||||
MIDI_Plug_Arc_Base(9, false);
|
||||
|
||||
difference() {
|
||||
translate([0, -eps, 0])
|
||||
intersection() {
|
||||
translate([0, 4.5, 0]) MIDI_Plug_Arc_Base(4.5, true);
|
||||
rotate([0, 90, 0]) oval_prism(20.5, 5, 8, center=true, $fn = $preview ? 32 : 100);
|
||||
|
||||
// hull() {
|
||||
// rotate([ 0, 0, 0]) MIDI_Plug_Arc_Base(0.1);
|
||||
// rotate([-90, 0, 0]) scale([1, 1, 0.6]) MIDI_Plug_Arc_Base(0.1);
|
||||
// }
|
||||
|
||||
//
|
||||
}
|
||||
MIDI_Plug_Cutout();
|
||||
}
|
||||
}
|
||||
|
||||
module MIDI_Plug_Arc_Base(height, filled)
|
||||
{
|
||||
difference()
|
||||
{
|
||||
rotate([90, 0, 0]) {
|
||||
if(filled==true) {
|
||||
oval_prism(height, 18.5/2-1.25, 10.2, $fn = $preview ? 32 : 100);
|
||||
}
|
||||
if(filled==false) {
|
||||
oval_tube(height, 18.5/2 + 1, 8, 1, $fn = $preview ? 32 : 100);
|
||||
}
|
||||
}
|
||||
translate([0, -height/2+0.01, -5]) cube([40, 2*height, 10], center=true);
|
||||
}
|
||||
}
|
||||
208
Housing/RP2350_MIDI_Lighter_PCB.scad
Normal file
208
Housing/RP2350_MIDI_Lighter_PCB.scad
Normal file
@@ -0,0 +1,208 @@
|
||||
use <MCAD/boxes.scad>
|
||||
include <RP2350_MIDI_Lighter_Definition.scad>
|
||||
|
||||
|
||||
module PCB()
|
||||
{
|
||||
color([0.0, 1.0, 0.0])
|
||||
difference()
|
||||
{
|
||||
union()
|
||||
{
|
||||
translate([PCB_W/2, PCB_H/2+5, 0]) roundedBox([PCB_W, PCB_H-10, PCB_T], 2, true, $fn=100);
|
||||
translate([PCB_W/2, PCB_H/2-5, 0]) roundedBox([PCB_W, PCB_H-10, PCB_T], 1, true, $fn=100);
|
||||
}
|
||||
|
||||
Screw_Holes_M3();
|
||||
}
|
||||
|
||||
translate([0, 0, PCB_T/2]) translate(Power_Plug) Power_Plug();
|
||||
translate([0, 0, PCB_T/2]) translate(Button) Button();
|
||||
}
|
||||
|
||||
module PCB_Cutouts_Top()
|
||||
{
|
||||
translate([0, 0, PCB_T/2-0.3]) translate(Power_Plug) Power_Plug_Cutout();
|
||||
translate([0, 0, PCB_T/2-0.5]) translate(Button) Button_Cutout();
|
||||
translate([0, 0, PCB_T/2-0.0]) translate([0, 33, 0]) USB_Cutout();
|
||||
}
|
||||
|
||||
module PCB_Cutouts_From_Bottom()
|
||||
{
|
||||
translate([0, 0, PCB_T/2-0.3 + 09.7]) translate(Power_Plug) Power_Plug_Cutout_For_Bottom();
|
||||
translate([0, 0, PCB_T/2-0.5]) translate(Button) Button_Cutout_For_Bottom();
|
||||
translate([0, 0, 0]) translate([0, 33, 0]) USB_Cutout_Small();
|
||||
translate([0, 0, 0]) translate([0, 33, 0]) Adafruit_QT_Py_Cutout();
|
||||
}
|
||||
|
||||
module Screw_Holes_M3()
|
||||
{
|
||||
for (i = Mounting_Holes) {
|
||||
translate(i) Screw_Drill(Drill_M3);
|
||||
}
|
||||
}
|
||||
|
||||
module Screw_Rings_M3()
|
||||
{
|
||||
for (i = Mounting_Holes) {
|
||||
translate(i) Screw_Ring_M3(Ring_M3_H);
|
||||
}
|
||||
}
|
||||
|
||||
module Spacer(height)
|
||||
{
|
||||
difference()
|
||||
{
|
||||
cylinder(h=height, d=5, $fn=6);
|
||||
Screw_Drill(Drill_M3);
|
||||
}
|
||||
}
|
||||
|
||||
module Spacer_Top()
|
||||
{
|
||||
color([0.3, 0.6, 0.0])
|
||||
for (i = Mounting_Holes) {
|
||||
translate(i) Spacer(Spacer_Top_Height);
|
||||
}
|
||||
}
|
||||
|
||||
module Spacer_Bot()
|
||||
{
|
||||
color([0.3, 0.6, 0.0])
|
||||
translate([0, 0, -Spacer_Bot_Height])
|
||||
for (i = Mounting_Holes) {
|
||||
translate(i) Spacer(Spacer_Bot_Height);
|
||||
}
|
||||
}
|
||||
|
||||
module Button()
|
||||
{
|
||||
translate([0, 0, 7.4/2])
|
||||
{
|
||||
translate([-3.5/2, 0, 0]) cube([3.5, 7.3, 7.4], center=true);
|
||||
|
||||
color([1, 0.65,0 ])
|
||||
translate([+3.9/2, 0, 0]) cube([3.9, 3.5, 3.5], center=true);
|
||||
}
|
||||
}
|
||||
|
||||
module Button_Cutout()
|
||||
{
|
||||
Button_W = 8;
|
||||
Button_H = 8;
|
||||
|
||||
Button_X = 30;
|
||||
Button_Z = 20;
|
||||
|
||||
translate([+Button_X/2, 0, -Button_Z/2 + Button_H])
|
||||
cube([Button_X, Button_W, Button_Z], center=true);
|
||||
}
|
||||
|
||||
module Button_Cutout_For_Bottom()
|
||||
{
|
||||
Button_W = 8;
|
||||
Button_H = 8;
|
||||
|
||||
Button_X = 1.5;
|
||||
Button_Z = 20;
|
||||
|
||||
translate([+PCB_W - Button[0] + Wall_PCB_GAP + Button_X/2 - eps, 0, +Button_Z/2])
|
||||
cube([Button_X, Button_W, Button_Z], center=true);
|
||||
|
||||
translate([+PCB_W - Button[0] + Wall_PCB_GAP + Button_X/2 - eps, 0, 4.75])
|
||||
cube([3*Button_X, 3.5, 3.5], center=true);
|
||||
}
|
||||
|
||||
module Power_Plug()
|
||||
{
|
||||
color([0.1, 0.1, 0.1])
|
||||
translate([10.625, -2.4, 0])
|
||||
difference()
|
||||
{
|
||||
translate([-3.5, 0, 0])
|
||||
union()
|
||||
{
|
||||
translate([3.5/2, 0, 11/2]) cube([ 3.5, 9, 11.0], center=true);
|
||||
translate([-10.9/2, 0, 6.4/2]) cube([10.9, 9, 6.4], center=true);
|
||||
translate([-10.9/2, 0, 6.4]) rotate([0, 90, 0]) cylinder(h=10.9, d=9, center=true, $fn=60);
|
||||
}
|
||||
|
||||
translate([-9.2/2, 0, 6.4])
|
||||
rotate([0, 90, 0])
|
||||
cylinder(h=9.2+1, d=6.3, center=true, $fn=60);
|
||||
}
|
||||
}
|
||||
|
||||
module Power_Plug_Cutout()
|
||||
{
|
||||
Plug_D = 14.5;
|
||||
Plug_W = 10;
|
||||
Plug_H = 11.5;
|
||||
|
||||
Plug_X = 30;
|
||||
Plug_Z = 20;
|
||||
|
||||
translate([+Plug_X/2-Plug_D+5.08, -2.4, -Plug_Z/2 + Plug_H])
|
||||
cube([Plug_X, Plug_W, Plug_Z], center=true);
|
||||
}
|
||||
|
||||
module Power_Plug_Cutout_For_Bottom()
|
||||
{
|
||||
Plug_D = 14.5;
|
||||
Plug_W = 10;
|
||||
Plug_H = 11.5;
|
||||
|
||||
Plug_X = 30;
|
||||
Plug_Z = 20;
|
||||
|
||||
translate([+Plug_X/2-Plug_D+5.08, -0, -Plug_Z/2 + Plug_H + 5])
|
||||
cube([Plug_X, Plug_W, Plug_Z], center=true);
|
||||
|
||||
translate([0, 0.5, -3])
|
||||
rotate([0, 90, 0])
|
||||
cylinder(d=11, h=Plug_X, center=true, $fn=60);
|
||||
}
|
||||
|
||||
module USB_Cutout()
|
||||
{
|
||||
USB_H = 3.2;
|
||||
USB_W = 9;
|
||||
USB_D = 22;
|
||||
|
||||
USB_Y = 9.5;
|
||||
USB_Z = 20;
|
||||
|
||||
|
||||
PCB_H = 1.6;
|
||||
PCB_W = 18;
|
||||
PCB_D = 22;
|
||||
|
||||
PCB_X = 40;
|
||||
PCB_Z = 5;
|
||||
|
||||
translate([0, 0, -USB_Z/2 + PCB_H + USB_H - 0.5]) cube([USB_D, USB_Y, USB_Z], center=true);
|
||||
// translate([-PCB_X/2+PCB_D, 0, -PCB_Z/2 + PCB_H]) cube([PCB_X, PCB_W, PCB_Z], center=true);
|
||||
}
|
||||
|
||||
module USB_Cutout_Small()
|
||||
{
|
||||
USB_H = 3.2;
|
||||
USB_W = 9;
|
||||
USB_D = 22;
|
||||
|
||||
USB_Y = 9.5;
|
||||
USB_Z = 3.5;
|
||||
|
||||
|
||||
PCB_H = 1.6;
|
||||
PCB_W = 18;
|
||||
PCB_D = 22;
|
||||
|
||||
PCB_X = 40;
|
||||
PCB_Z = 5;
|
||||
|
||||
translate([0, 0.5, USB_Z/2 + PCB_H + 1.0])
|
||||
rotate([0, 90, 0])
|
||||
roundedBox([USB_Z, USB_Y, USB_D], 1, true, $fn = $preview ? 32 : 100);
|
||||
// cube([USB_D, USB_Y, USB_Z], center=true);
|
||||
}
|
||||
Reference in New Issue
Block a user