Добавил файлы

This commit is contained in:
Калинин Сергей Валерьевич 2024-12-20 15:56:57 +03:00
parent 055c5c9fa9
commit b8f0197548
15 changed files with 7372 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
amplifier-control-panel-backups/*

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,75 @@
{
"board": {
"active_layer": 0,
"active_layer_preset": "All Layers",
"auto_track_width": true,
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"pads": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 0.6
},
"ratsnest_display_mode": 0,
"selection_filter": {
"dimensions": true,
"footprints": true,
"graphics": true,
"keepouts": true,
"lockedItems": true,
"otherItems": true,
"pads": true,
"text": true,
"tracks": true,
"vias": true,
"zones": true
},
"visible_items": [
0,
1,
2,
3,
4,
5,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
32,
33,
34,
35,
36
],
"visible_layers": "fffffff_ffffffff",
"zone_display_mode": 0
},
"meta": {
"filename": "amplifier-control-panel.kicad_prl",
"version": 3
},
"project": {
"files": []
}
}

View File

@ -0,0 +1,434 @@
{
"board": {
"design_settings": {
"defaults": {
"board_outline_line_width": 0.09999999999999999,
"copper_line_width": 0.19999999999999998,
"copper_text_italic": false,
"copper_text_size_h": 1.5,
"copper_text_size_v": 1.5,
"copper_text_thickness": 0.3,
"copper_text_upright": false,
"courtyard_line_width": 0.049999999999999996,
"dimension_precision": 4,
"dimension_units": 3,
"dimensions": {
"arrow_length": 1270000,
"extension_offset": 500000,
"keep_text_aligned": true,
"suppress_zeroes": false,
"text_position": 0,
"units_format": 1
},
"fab_line_width": 0.09999999999999999,
"fab_text_italic": false,
"fab_text_size_h": 1.0,
"fab_text_size_v": 1.0,
"fab_text_thickness": 0.15,
"fab_text_upright": false,
"other_line_width": 0.15,
"other_text_italic": false,
"other_text_size_h": 1.0,
"other_text_size_v": 1.0,
"other_text_thickness": 0.15,
"other_text_upright": false,
"pads": {
"drill": 0.762,
"height": 1.524,
"width": 1.524
},
"silk_line_width": 0.15,
"silk_text_italic": false,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.15,
"silk_text_upright": false,
"zones": {
"45_degree_only": false,
"min_clearance": 0.508
}
},
"diff_pair_dimensions": [
{
"gap": 0.0,
"via_gap": 0.0,
"width": 0.0
}
],
"drc_exclusions": [],
"meta": {
"version": 2
},
"rule_severities": {
"annular_width": "error",
"clearance": "error",
"copper_edge_clearance": "error",
"courtyards_overlap": "error",
"diff_pair_gap_out_of_range": "error",
"diff_pair_uncoupled_length_too_long": "error",
"drill_out_of_range": "error",
"duplicate_footprints": "warning",
"extra_footprint": "warning",
"footprint_type_mismatch": "error",
"hole_clearance": "error",
"hole_near_hole": "error",
"invalid_outline": "error",
"item_on_disabled_layer": "error",
"items_not_allowed": "error",
"length_out_of_range": "error",
"malformed_courtyard": "error",
"microvia_drill_out_of_range": "error",
"missing_courtyard": "ignore",
"missing_footprint": "warning",
"net_conflict": "warning",
"npth_inside_courtyard": "ignore",
"padstack": "error",
"pth_inside_courtyard": "ignore",
"shorting_items": "error",
"silk_over_copper": "warning",
"silk_overlap": "warning",
"skew_out_of_range": "error",
"through_hole_pad_without_hole": "error",
"too_many_vias": "error",
"track_dangling": "warning",
"track_width": "error",
"tracks_crossing": "error",
"unconnected_items": "error",
"unresolved_variable": "error",
"via_dangling": "warning",
"zone_has_empty_net": "error",
"zones_intersect": "error"
},
"rules": {
"allow_blind_buried_vias": false,
"allow_microvias": false,
"max_error": 0.005,
"min_clearance": 0.0,
"min_copper_edge_clearance": 0.0,
"min_hole_clearance": 0.25,
"min_hole_to_hole": 0.25,
"min_microvia_diameter": 0.19999999999999998,
"min_microvia_drill": 0.09999999999999999,
"min_silk_clearance": 0.0,
"min_through_hole_diameter": 0.3,
"min_track_width": 0.19999999999999998,
"min_via_annular_width": 0.049999999999999996,
"min_via_diameter": 0.39999999999999997,
"solder_mask_clearance": 0.0,
"solder_mask_min_width": 0.0,
"use_height_for_length_calcs": true
},
"track_widths": [
0.0,
0.5
],
"via_dimensions": [
{
"diameter": 0.0,
"drill": 0.0
}
],
"zones_allow_external_fillets": false,
"zones_use_no_outline": true
},
"layer_presets": []
},
"boards": [],
"cvpcb": {
"equivalence_files": []
},
"erc": {
"erc_exclusions": [],
"meta": {
"version": 0
},
"pin_map": [
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
1,
0,
1,
2
],
[
0,
1,
0,
0,
0,
0,
1,
1,
2,
1,
1,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
],
[
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
2
],
[
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
1,
2,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
0,
2,
1,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
]
],
"rule_severities": {
"bus_definition_conflict": "error",
"bus_entry_needed": "error",
"bus_label_syntax": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"extra_units": "error",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "warning",
"multiple_net_names": "warning",
"net_not_bus_member": "warning",
"no_connect_connected": "warning",
"no_connect_dangling": "warning",
"pin_not_connected": "error",
"pin_not_driven": "error",
"pin_to_pin": "warning",
"power_pin_not_driven": "error",
"similar_labels": "warning",
"unannotated": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "amplifier-control-panel.kicad_pro",
"version": 1
},
"net_settings": {
"classes": [
{
"bus_width": 12.0,
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "Default",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 0.25,
"via_diameter": 0.8,
"via_drill": 0.4,
"wire_width": 6.0
}
],
"meta": {
"version": 2
},
"net_colors": null
},
"pcbnew": {
"last_paths": {
"gencad": "",
"idf": "",
"netlist": "",
"specctra_dsn": "",
"step": "",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"annotate_start_num": 0,
"drawing": {
"default_line_thickness": 6.0,
"default_text_size": 50.0,
"field_names": [],
"intersheets_ref_own_page": false,
"intersheets_ref_prefix": "",
"intersheets_ref_short": false,
"intersheets_ref_show": false,
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.375,
"pin_symbol_size": 25.0,
"text_offset_ratio": 0.15
},
"legacy_lib_dir": "",
"legacy_lib_list": [],
"meta": {
"version": 1
},
"net_format_name": "",
"ngspice": {
"fix_include_paths": true,
"fix_passive_vals": false,
"meta": {
"version": 0
},
"model_mode": 0,
"workbook_filename": ""
},
"page_layout_descr_file": "",
"plot_directory": "",
"spice_adjust_passive_values": false,
"spice_external_command": "spice \"%I\"",
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [
[
"7542dd62-069b-4d1c-a8e7-176236a1cd0d",
""
]
],
"text_variables": {}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,217 @@
// https://www.hackster.io/mircemk/diy-arduino-vfd-display-20x2-vu-volume-unit-meter-37898f
// #include <LiquidCrystal.h>
#include <LiquidCrystal_I2C.h>
// Выходы для управления реле (вкл.вкл ЦАП/Блютуз)
#define RELAY_DAC 6
#define RELAY_BT 7
// LiquidCrystal lcdVuMeterVuMeter(12, 11, 5, 4, 3, 2);// RS,E,D4,D5,D6,D7
LiquidCrystal_I2C lcdVuMeter(0x26, 16, 2);
LiquidCrystal_I2C lcdInfo(0x27, 16, 2);
byte a1[8]={
0b00000,0b11011,0b11011,0b11011,0b11011,0b11011,0b11011,0b11011};
byte a2[8]={
0b00000,0b11000,0b11000,0b11000,0b11000,0b11000,0b11000,0b11000};
byte a3[8]={
0b00000,0b00011,0b00011,0b00011,0b00011,0b00011,0b00011,0b00011};
byte znak_r[8]={ // R
B00000,
B11100,
B10010,
B10010,
B11100,
B11000,
B10100,
B10010};
byte znak_l[8]={ // L
B00000,
B10000,
B10000,
B10000,
B10000,
B10000,
B10000,
B11110};
int u_r,u_l,i=1,x,u_maxr,u_maxl,z,z1,u_r0[15],u_l0[15];
unsigned long time1;
long decayTime = 0;
void setup(){
analogReference(INTERNAL);
lcdVuMeter.init();
lcdVuMeter.backlight();
lcdVuMeter.clear();
lcdVuMeter.setCursor(0, 0);
// lcdVuMeter.begin(16, 2);// lcdVuMeter 16X2
lcdVuMeter.createChar(0,a1);
lcdVuMeter.createChar(1,a2);
lcdVuMeter.createChar(2,znak_r);
lcdVuMeter.createChar(3,znak_l);
lcdVuMeter.createChar(4,a3);
lcdInfo.init();
lcdInfo.backlight();
lcdInfo.clear();
lcdInfo.setCursor(0, 0);
lcdInfo.print("DAC");
// Вход аудио-сигнала
pinMode(A0,INPUT);
pinMode(A1,INPUT);
// Кнопка управления (переключения)
pinMode(3, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
pinMode(10, INPUT_PULLUP);
// Выходы для управления реле (вкл.вкл ЦАП/Блютуз)
pinMode(RELAY_DAC, OUTPUT);
pinMode(RELAY_BT, OUTPUT);
digitalWrite(RELAY_DAC, HIGH);
lcdVuMeter.clear();
// lcdVuMeter.setCursor(5, 0);
// lcdVuMeter.print("Loading...");
// for (int i = 0; i < 20; i++)
// {
// lcdVuMeter.setCursor(i, 1);
// lcdVuMeter.write(1);
//
// delay(100);
// }
delay(5);
lcdVuMeter.clear();
decayTime = millis();
}
bool usb = true;
bool blueTooth = false;
uint32_t btnTimer = 0;
void loop(){
lcdVuMeter.setCursor(0,0);// R
lcdVuMeter.write((uint8_t)2);
lcdVuMeter.setCursor(0,1);
lcdVuMeter.write((uint8_t)3);// L
u_r = analogRead(A0); // измерение R
u_l = analogRead(A2); // измерение L
for(int z=1,z1=0,z2=30;z<=15;z++,z1=z1+30,z2=z2+30){ // l+r
if(u_l>z1){
lcdVuMeter.setCursor(z,1);
lcdVuMeter.write((uint8_t)1);
}
if(u_r>z1){
lcdVuMeter.setCursor(z,0);
lcdVuMeter.write((uint8_t)1);
}
if(u_l>z2){
lcdVuMeter.setCursor(z,1);
lcdVuMeter.write((uint8_t)0);
}
if(u_r>z2){
lcdVuMeter.setCursor(z,0);
lcdVuMeter.write((uint8_t)0);
}
}
i++;
if(i<=15){
u_l0[i]=u_l;
u_r0[i]=u_r;
}
else{
i=1;
}
if(i==15){
u_maxr=0;
u_maxl=0;
for(x=1;x<=15;x++){
u_maxl=max(u_maxl,u_l0[x]);
u_maxr=max(u_maxr,u_r0[x]);
}
}
if(u_maxl<=u_l){
u_maxl=u_l;
}
if(u_maxr<=u_r){
u_maxr=u_r;
}
//
// for(z=1,z1=0;z<=15;z++,z1=z1+30){
// if(u_maxl > z1 && u_maxl <= z1+15){
// lcdVuMeter.setCursor(z,1);
// lcdVuMeter.write((uint8_t)1);
// }
// if(u_maxl > z1+15 && u_maxl <= z1+30){
// lcdVuMeter.setCursor(z,1);
// lcdVuMeter.write((uint8_t)4);
// }
//
// if(u_maxr > z1 && u_maxr <= z1+15){
// lcdVuMeter.setCursor(z,0);
// lcdVuMeter.write((uint8_t)1);
// }
// if(u_maxr > z1+15 && u_maxr <= z1+30){
// lcdVuMeter.setCursor(z,0);
// lcdVuMeter.write((uint8_t)4);
// }
// }
delay(30);
lcdVuMeter.clear();
// читаем инвертированное значение для удобства
bool btnState = digitalRead(3);
if (btnState&& millis() - btnTimer > 100) { // обработчик нажатия
lcdInfo.clear();
if (!usb && blueTooth) {
usb = true;
blueTooth = false;
btnTimer = millis();
lcdInfo.setCursor(0,0);
lcdInfo.print("DAC");
delay(1000);
digitalWrite(RELAY_BT, LOW);
digitalWrite(RELAY_DAC, HIGH);
} else if (usb && !blueTooth&& millis() - btnTimer > 100) {
usb = false;
blueTooth = true;
btnTimer = millis();
lcdInfo.setCursor(0,0);
lcdInfo.print("Bluetooth");
delay(1000);
digitalWrite(RELAY_DAC, LOW);
digitalWrite(RELAY_BT, HIGH);
}
lcdInfo.setCursor(0,1);
// lcdInfo.print(btnState);
}
if (digitalRead(8) && usb) {
lcdInfo.setCursor(0,1);
lcdInfo.print("Coaxial");
} else if (digitalRead(9) && usb) {
lcdInfo.setCursor(0,1);
lcdInfo.print("Optical");
} else if (digitalRead(10) && usb) {
lcdInfo.setCursor(0,1);
lcdInfo.print("Audio ");
} else {
lcdInfo.setCursor(0,1);
lcdInfo.print(" ");
}
lcdInfo.setCursor(11,1);
lcdInfo.print(digitalRead(8), digitalRead(9));
// if (!btnState) { // обработчик отпускания
// lcdInfo.clear();
// lcdInfo.setCursor(0,1);
// lcdInfo.print(btnState);
// //Serial.println("release");
// }
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB