Commit e8ed743f authored by David Huss's avatar David Huss 💬
Browse files

Fix Typo : )

parent 009bb5de
%% Cell type:code id: tags:
``` python
# Change these values to calculate the needed values
requirements = {"inputs": 8, "outputs":8}
# Do not edit below this Point unless you know what you are doing
data = {
"mami-input": {
"input-channels": 2,
"parts": [
{"MPN": "PJ301M-12", "n": 2},
{"MPN": "Subminiature On-Off-(On) Toggle switch", "n": 2},
]
},
"mami-output": {
"output-channels": 2,
"parts": [
{"MPN": "LME49720", "n": 2},
{"MPN": "100nF 0605 25V", "n": 4},
{"MPN": "100nF 0603 25V", "n": 4},
{"MPN": "100k 0805", "n": 6},
{"MPN": "100R 0805", "n": 2},
{"MPN": "PJ301M-12", "n": 2}
]
},
"mami-quad": {
"input-channels":2, "output-channels":2,
"parts": [
{"MPN": "P0915N-FC15BR100K", "n": 4},
{"MPN": "Knob", "n": 4},
{"MPN": "100k 0805", "n": 4}
]
}
}
# Calculate how many PCBs are needed
n_input_modules = int(requirements["inputs"] / data["mami-input"]["input-channels"])
n_output_modules = int(requirements["outputs"] / data["mami-output"]["output-channels"])
n_quad_modules = int((requirements["inputs"] * requirements["outputs"]) / (data["mami-output"]["output-channels"] * data["mami-input"]["input-channels"]))
Print the PCB
print("Needed for a {}x{} Matrix Mixer".format(requirements["inputs"], requirements["outputs"]))
print("{}".format("="*50))
print("{0:>5}x MAMI-INPUT-Module".format(n_input_modules))
print("{0:>5}x MAMI-OUTPUT-Module".format(n_output_modules))
print("{0:>5}x MAMI-QUAD-Module\n".format(n_quad_modules))
# Collect all the parts
bom = {}
for part in data["mami-input"]["parts"]*n_input_modules + data["mami-quad"]["parts"]*n_quad_modules + data["mami-output"]["parts"]*n_output_modules:
if part["MPN"] in bom:
bom[part["MPN"]] += part["n"]
else:
bom[part["MPN"]] = part["n"]
# Print the BOM
print("Parts\n{}".format("="*50))
for key, value in bom.items():
print("{:>5}x {}".format(value, key))
```
%% Output
Needed for a 8x8 Matrix Mixer:
==================================================
4x MAMI-INPUT-Module
4x MAMI-OUTPUT-Module
16x MAMI-QUAD-Module
Parts
==================================================
16x PJ301M-12
8x Subminiature On-Off-(On) Toggle switch
64x P0915N-FC15BR100K
64x Knob
96x 100k 0805
8x LME49720
16x 100nF 0605 25V
%% Cell type:code id: tags:
``` python
for i in range(5,15):
print("{}... QUAD: {} IN: {} OUT: {}, Channels: {}".format(i, 16*i, 4*i, 4*i, 8*i))
```
%% Output
5... QUAD: 80 IN: 20 OUT: 20, Channels: 40
6... QUAD: 96 IN: 24 OUT: 24, Channels: 48
7... QUAD: 112 IN: 28 OUT: 28, Channels: 56
8... QUAD: 128 IN: 32 OUT: 32, Channels: 64
9... QUAD: 144 IN: 36 OUT: 36, Channels: 72
10... QUAD: 160 IN: 40 OUT: 40, Channels: 80
11... QUAD: 176 IN: 44 OUT: 44, Channels: 88
12... QUAD: 192 IN: 48 OUT: 48, Channels: 96
13... QUAD: 208 IN: 52 OUT: 52, Channels: 104
14... QUAD: 224 IN: 56 OUT: 56, Channels: 112
%% Cell type:code id: tags:
``` python
```
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment