Compare commits

..
18 Commits
46 changed files with 96836 additions and 306 deletions
Binary file not shown.
File diff suppressed because it is too large Load Diff
+74
View File
@@ -0,0 +1,74 @@
%TF.GenerationSoftware,KiCad,Pcbnew,6.0.11+dfsg-1*%
%TF.CreationDate,2025-01-28T23:33:11+01:00*%
%TF.ProjectId,Hanglamp,48616e67-6c61-46d7-902e-6b696361645f,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Soldermask,Bot*%
%TF.FilePolarity,Negative*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 6.0.11+dfsg-1) date 2025-01-28 23:33:11*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%ADD10C,2.109000*%
%ADD11R,1.700000X1.700000*%
%ADD12O,1.700000X1.700000*%
%ADD13R,2.800000X2.800000*%
%ADD14O,2.800000X2.800000*%
G04 APERTURE END LIST*
D10*
%TO.C,U1*%
X167640000Y-73920000D03*
X167640000Y-71380000D03*
X167640000Y-68840000D03*
X167640000Y-66300000D03*
X167640000Y-61220000D03*
X167640000Y-63760000D03*
X152400000Y-56140000D03*
X167640000Y-56140000D03*
X152400000Y-58680000D03*
X152400000Y-61220000D03*
X152400000Y-63760000D03*
X152400000Y-66300000D03*
X152400000Y-68840000D03*
X152400000Y-71380000D03*
X152400000Y-73920000D03*
X167640000Y-58680000D03*
%TD*%
D11*
%TO.C,J3*%
X147320000Y-71120000D03*
D12*
X147320000Y-73660000D03*
X147320000Y-76200000D03*
%TD*%
D11*
%TO.C,J1*%
X175260000Y-66040000D03*
D12*
X175260000Y-68580000D03*
X175260000Y-71120000D03*
X175260000Y-73660000D03*
X175260000Y-76200000D03*
%TD*%
D11*
%TO.C,J4*%
X132080000Y-73660000D03*
D12*
X132080000Y-76200000D03*
%TD*%
D13*
%TO.C,D1*%
X132080000Y-55880000D03*
D14*
X132080000Y-66040000D03*
%TD*%
D11*
%TO.C,J2*%
X142240000Y-71120000D03*
D12*
X142240000Y-73660000D03*
X142240000Y-76200000D03*
%TD*%
M02*
+15
View File
@@ -0,0 +1,15 @@
%TF.GenerationSoftware,KiCad,Pcbnew,6.0.11+dfsg-1*%
%TF.CreationDate,2025-01-28T23:33:11+01:00*%
%TF.ProjectId,Hanglamp,48616e67-6c61-46d7-902e-6b696361645f,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Paste,Bot*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 6.0.11+dfsg-1) date 2025-01-28 23:33:11*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*
@@ -0,0 +1,15 @@
%TF.GenerationSoftware,KiCad,Pcbnew,6.0.11+dfsg-1*%
%TF.CreationDate,2025-01-28T23:33:11+01:00*%
%TF.ProjectId,Hanglamp,48616e67-6c61-46d7-902e-6b696361645f,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Legend,Bot*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 6.0.11+dfsg-1) date 2025-01-28 23:33:11*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*
+26
View File
@@ -0,0 +1,26 @@
%TF.GenerationSoftware,KiCad,Pcbnew,6.0.11+dfsg-1*%
%TF.CreationDate,2025-01-28T23:33:11+01:00*%
%TF.ProjectId,Hanglamp,48616e67-6c61-46d7-902e-6b696361645f,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Profile,NP*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 6.0.11+dfsg-1) date 2025-01-28 23:33:11*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%TA.AperFunction,Profile*%
%ADD10C,0.100000*%
%TD*%
G04 APERTURE END LIST*
D10*
X177800000Y-78740000D02*
X177800000Y-53340000D01*
X129540000Y-78740000D02*
X177800000Y-78740000D01*
X129540000Y-53340000D02*
X129540000Y-78740000D01*
X177800000Y-53340000D02*
X129540000Y-53340000D01*
M02*
+365
View File
@@ -0,0 +1,365 @@
%TF.GenerationSoftware,KiCad,Pcbnew,6.0.11+dfsg-1*%
%TF.CreationDate,2025-01-28T23:33:11+01:00*%
%TF.ProjectId,Hanglamp,48616e67-6c61-46d7-902e-6b696361645f,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Copper,L1,Top*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 6.0.11+dfsg-1) date 2025-01-28 23:33:11*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 Aperture macros list*
%AMRoundRect*
0 Rectangle with rounded corners*
0 $1 Rounding radius*
0 $2 $3 $4 $5 $6 $7 $8 $9 X,Y pos of 4 corners*
0 Add a 4 corners polygon primitive as box body*
4,1,4,$2,$3,$4,$5,$6,$7,$8,$9,$2,$3,0*
0 Add four circle primitives for the rounded corners*
1,1,$1+$1,$2,$3*
1,1,$1+$1,$4,$5*
1,1,$1+$1,$6,$7*
1,1,$1+$1,$8,$9*
0 Add four rect primitives between the rounded corners*
20,1,$1+$1,$2,$3,$4,$5,0*
20,1,$1+$1,$4,$5,$6,$7,0*
20,1,$1+$1,$6,$7,$8,$9,0*
20,1,$1+$1,$8,$9,$2,$3,0*%
G04 Aperture macros list end*
%TA.AperFunction,ComponentPad*%
%ADD10C,1.905000*%
%TD*%
%TA.AperFunction,ComponentPad*%
%ADD11R,1.700000X1.700000*%
%TD*%
%TA.AperFunction,ComponentPad*%
%ADD12O,1.700000X1.700000*%
%TD*%
%TA.AperFunction,SMDPad,CuDef*%
%ADD13RoundRect,0.165000X-0.165000X-0.475000X0.165000X-0.475000X0.165000X0.475000X-0.165000X0.475000X0*%
%TD*%
%TA.AperFunction,ComponentPad*%
%ADD14R,2.800000X2.800000*%
%TD*%
%TA.AperFunction,ComponentPad*%
%ADD15O,2.800000X2.800000*%
%TD*%
%TA.AperFunction,SMDPad,CuDef*%
%ADD16R,0.900000X1.500000*%
%TD*%
%TA.AperFunction,ViaPad*%
%ADD17C,0.800000*%
%TD*%
%TA.AperFunction,Conductor*%
%ADD18C,0.250000*%
%TD*%
G04 APERTURE END LIST*
D10*
%TO.P,U1,0,GPIO0*%
%TO.N,Net-(J1-Pad4)*%
X167640000Y-73920000D03*
%TO.P,U1,1,GPIO1*%
%TO.N,Net-(J1-Pad3)*%
X167640000Y-71380000D03*
%TO.P,U1,2,GPIO2*%
%TO.N,Net-(J1-Pad2)*%
X167640000Y-68840000D03*
%TO.P,U1,3,GPIO3*%
%TO.N,unconnected-(U1-Pad3)*%
X167640000Y-66300000D03*
%TO.P,U1,3.3,3V3*%
%TO.N,+3.3V*%
X167640000Y-61220000D03*
%TO.P,U1,4,GPIO4*%
%TO.N,unconnected-(U1-Pad4)*%
X167640000Y-63760000D03*
%TO.P,U1,5,GPIO5*%
%TO.N,GPIO5*%
X152400000Y-56140000D03*
%TO.P,U1,5V,5V*%
%TO.N,+5V*%
X167640000Y-56140000D03*
%TO.P,U1,6,GPIO6*%
%TO.N,GPIO6*%
X152400000Y-58680000D03*
%TO.P,U1,7,GPIO7*%
%TO.N,unconnected-(U1-Pad7)*%
X152400000Y-61220000D03*
%TO.P,U1,8,GPIO8*%
%TO.N,unconnected-(U1-Pad8)*%
X152400000Y-63760000D03*
%TO.P,U1,9,GPIO9*%
%TO.N,unconnected-(U1-Pad9)*%
X152400000Y-66300000D03*
%TO.P,U1,10,GPIO10*%
%TO.N,unconnected-(U1-Pad10)*%
X152400000Y-68840000D03*
%TO.P,U1,20,GPIO20*%
%TO.N,unconnected-(U1-Pad20)*%
X152400000Y-71380000D03*
%TO.P,U1,21,GPIO21*%
%TO.N,unconnected-(U1-Pad21)*%
X152400000Y-73920000D03*
%TO.P,U1,G,GND*%
%TO.N,GND*%
X167640000Y-58680000D03*
%TD*%
D11*
%TO.P,J3,1,Pin_1*%
%TO.N,+5V*%
X147320000Y-71120000D03*
D12*
%TO.P,J3,2,Pin_2*%
X147320000Y-73660000D03*
%TO.P,J3,3,Pin_3*%
X147320000Y-76200000D03*
%TD*%
D11*
%TO.P,J1,1,Pin_1*%
%TO.N,GND*%
X175260000Y-66040000D03*
D12*
%TO.P,J1,2,Pin_2*%
%TO.N,Net-(J1-Pad2)*%
X175260000Y-68580000D03*
%TO.P,J1,3,Pin_3*%
%TO.N,Net-(J1-Pad3)*%
X175260000Y-71120000D03*
%TO.P,J1,4,Pin_4*%
%TO.N,Net-(J1-Pad4)*%
X175260000Y-73660000D03*
%TO.P,J1,5,Pin_5*%
%TO.N,+3.3V*%
X175260000Y-76200000D03*
%TD*%
D13*
%TO.P,C2,2*%
%TO.N,GND*%
X145905000Y-66040000D03*
%TO.P,C2,1*%
%TO.N,+4V*%
X144825000Y-66040000D03*
%TD*%
D11*
%TO.P,J4,1,Pin_1*%
%TO.N,STRIP1*%
X132080000Y-73660000D03*
D12*
%TO.P,J4,2,Pin_2*%
%TO.N,STRIP2*%
X132080000Y-76200000D03*
%TD*%
D14*
%TO.P,D1,1,K*%
%TO.N,+5V*%
X132080000Y-55880000D03*
D15*
%TO.P,D1,2,A*%
%TO.N,+4V*%
X132080000Y-66040000D03*
%TD*%
D13*
%TO.P,C1,2*%
%TO.N,GND*%
X138285000Y-66040000D03*
%TO.P,C1,1*%
%TO.N,+4V*%
X137205000Y-66040000D03*
%TD*%
D16*
%TO.P,D3,4,DIN*%
%TO.N,GPIO6*%
X145130000Y-58510000D03*
%TO.P,D3,3,VSS*%
%TO.N,GND*%
X148430000Y-58510000D03*
%TO.P,D3,2,DOUT*%
%TO.N,STRIP2*%
X148430000Y-63410000D03*
%TO.P,D3,1,VDD*%
%TO.N,+4V*%
X145130000Y-63410000D03*
%TD*%
%TO.P,D2,1,VDD*%
%TO.N,+4V*%
X137510000Y-63410000D03*
%TO.P,D2,2,DOUT*%
%TO.N,STRIP1*%
X140810000Y-63410000D03*
%TO.P,D2,3,VSS*%
%TO.N,GND*%
X140810000Y-58510000D03*
%TO.P,D2,4,DIN*%
%TO.N,GPIO5*%
X137510000Y-58510000D03*
%TD*%
D11*
%TO.P,J2,1,Pin_1*%
%TO.N,GND*%
X142240000Y-71120000D03*
D12*
%TO.P,J2,2,Pin_2*%
X142240000Y-73660000D03*
%TO.P,J2,3,Pin_3*%
X142240000Y-76200000D03*
%TD*%
D17*
%TO.N,GND*%
X146720525Y-63365349D03*
X139115433Y-63424121D03*
X139700000Y-58420000D03*
X147320000Y-58420000D03*
%TD*%
D18*
%TO.N,STRIP2*%
X148430000Y-63410000D02*
X148430000Y-66404125D01*
X148430000Y-66404125D02*
X145935927Y-68898198D01*
X145935927Y-68898198D02*
X139381802Y-68898198D01*
X139381802Y-68898198D02*
X132080000Y-76200000D01*
%TO.N,GND*%
X138285000Y-66040000D02*
X139115433Y-65209567D01*
X139115433Y-65209567D02*
X139115433Y-63424121D01*
X145905000Y-66040000D02*
X146720525Y-65224475D01*
X146720525Y-65224475D02*
X146720525Y-63365349D01*
%TO.N,+4V*%
X144825000Y-66040000D02*
X144825000Y-63715000D01*
X144825000Y-63715000D02*
X145130000Y-63410000D01*
X143510000Y-62230000D02*
X143510000Y-66040000D01*
X137510000Y-63150000D02*
X139700000Y-60960000D01*
X137510000Y-63410000D02*
X137510000Y-63150000D01*
X139700000Y-60960000D02*
X142240000Y-60960000D01*
X142240000Y-60960000D02*
X143510000Y-62230000D01*
X143510000Y-66040000D02*
X144825000Y-66040000D01*
X132080000Y-66040000D02*
X137205000Y-66040000D01*
X137205000Y-66040000D02*
X137205000Y-63715000D01*
X137205000Y-63715000D02*
X137510000Y-63410000D01*
X144825000Y-66040000D02*
X144780000Y-66040000D01*
%TO.N,STRIP1*%
X140810000Y-63410000D02*
X140810000Y-66409340D01*
X140810000Y-66409340D02*
X133559340Y-73660000D01*
X133559340Y-73660000D02*
X132080000Y-73660000D01*
%TO.N,+5V*%
X158702500Y-54562500D02*
X133397500Y-54562500D01*
X162560000Y-58420000D02*
X158702500Y-54562500D01*
X147320000Y-76200000D02*
X152400000Y-76200000D01*
X152400000Y-76200000D02*
X162560000Y-66040000D01*
X162560000Y-66040000D02*
X162560000Y-58420000D01*
X162560000Y-58420000D02*
X164840000Y-56140000D01*
X147320000Y-76200000D02*
X152350922Y-76200000D01*
X152350922Y-76200000D02*
X162510922Y-66040000D01*
X162510922Y-66040000D02*
X162560000Y-66040000D01*
X164840000Y-56140000D02*
X167640000Y-56140000D01*
X133397500Y-54562500D02*
X132080000Y-55880000D01*
%TO.N,GPIO5*%
X152400000Y-56140000D02*
X152100000Y-55840000D01*
X140180000Y-55840000D02*
X137510000Y-58510000D01*
X152100000Y-55840000D02*
X140180000Y-55840000D01*
%TO.N,GND*%
X139790000Y-58510000D02*
X139700000Y-58420000D01*
X140810000Y-58510000D02*
X139790000Y-58510000D01*
X147410000Y-58510000D02*
X147320000Y-58420000D01*
X148430000Y-58510000D02*
X147410000Y-58510000D01*
%TO.N,+3.3V*%
X165360000Y-73920000D02*
X167640000Y-76200000D01*
X165360000Y-63500000D02*
X165360000Y-73920000D01*
X167640000Y-76200000D02*
X175260000Y-76200000D01*
%TO.N,GPIO6*%
X150310000Y-56590000D02*
X152400000Y-58680000D01*
X145130000Y-58210000D02*
X146750000Y-56590000D01*
X146750000Y-56590000D02*
X150310000Y-56590000D01*
X145130000Y-58510000D02*
X145130000Y-58210000D01*
%TO.N,Net-(J1-Pad2)*%
X175000000Y-68840000D02*
X175260000Y-68580000D01*
X167640000Y-68840000D02*
X175000000Y-68840000D01*
%TO.N,Net-(J1-Pad3)*%
X167640000Y-71380000D02*
X175000000Y-71380000D01*
X175000000Y-71380000D02*
X175260000Y-71120000D01*
%TO.N,Net-(J1-Pad4)*%
X175000000Y-73920000D02*
X175260000Y-73660000D01*
X167640000Y-73920000D02*
X175000000Y-73920000D01*
%TO.N,+3.3V*%
X167640000Y-61220000D02*
X165360000Y-63500000D01*
%TD*%
%TA.AperFunction,Conductor*%
%TO.N,+5V*%
G36*
X147516121Y-70886002D02*
G01*
X147562614Y-70939658D01*
X147574000Y-70992000D01*
X147574000Y-76328000D01*
X147553998Y-76396121D01*
X147500342Y-76442614D01*
X147448000Y-76454000D01*
X147192000Y-76454000D01*
X147123879Y-76433998D01*
X147077386Y-76380342D01*
X147066000Y-76328000D01*
X147066000Y-70992000D01*
X147086002Y-70923879D01*
X147139658Y-70877386D01*
X147192000Y-70866000D01*
X147448000Y-70866000D01*
X147516121Y-70886002D01*
G37*
%TD.AperFunction*%
%TD*%
M02*
+117
View File
@@ -0,0 +1,117 @@
%TF.GenerationSoftware,KiCad,Pcbnew,6.0.11+dfsg-1*%
%TF.CreationDate,2025-01-28T23:33:11+01:00*%
%TF.ProjectId,Hanglamp,48616e67-6c61-46d7-902e-6b696361645f,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Soldermask,Top*%
%TF.FilePolarity,Negative*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 6.0.11+dfsg-1) date 2025-01-28 23:33:11*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 Aperture macros list*
%AMRoundRect*
0 Rectangle with rounded corners*
0 $1 Rounding radius*
0 $2 $3 $4 $5 $6 $7 $8 $9 X,Y pos of 4 corners*
0 Add a 4 corners polygon primitive as box body*
4,1,4,$2,$3,$4,$5,$6,$7,$8,$9,$2,$3,0*
0 Add four circle primitives for the rounded corners*
1,1,$1+$1,$2,$3*
1,1,$1+$1,$4,$5*
1,1,$1+$1,$6,$7*
1,1,$1+$1,$8,$9*
0 Add four rect primitives between the rounded corners*
20,1,$1+$1,$2,$3,$4,$5,0*
20,1,$1+$1,$4,$5,$6,$7,0*
20,1,$1+$1,$6,$7,$8,$9,0*
20,1,$1+$1,$8,$9,$2,$3,0*%
G04 Aperture macros list end*
%ADD10C,2.109000*%
%ADD11R,1.700000X1.700000*%
%ADD12O,1.700000X1.700000*%
%ADD13RoundRect,0.165000X-0.165000X-0.475000X0.165000X-0.475000X0.165000X0.475000X-0.165000X0.475000X0*%
%ADD14R,2.800000X2.800000*%
%ADD15O,2.800000X2.800000*%
%ADD16R,0.900000X1.500000*%
G04 APERTURE END LIST*
D10*
%TO.C,U1*%
X167640000Y-73920000D03*
X167640000Y-71380000D03*
X167640000Y-68840000D03*
X167640000Y-66300000D03*
X167640000Y-61220000D03*
X167640000Y-63760000D03*
X152400000Y-56140000D03*
X167640000Y-56140000D03*
X152400000Y-58680000D03*
X152400000Y-61220000D03*
X152400000Y-63760000D03*
X152400000Y-66300000D03*
X152400000Y-68840000D03*
X152400000Y-71380000D03*
X152400000Y-73920000D03*
X167640000Y-58680000D03*
%TD*%
D11*
%TO.C,J3*%
X147320000Y-71120000D03*
D12*
X147320000Y-73660000D03*
X147320000Y-76200000D03*
%TD*%
D11*
%TO.C,J1*%
X175260000Y-66040000D03*
D12*
X175260000Y-68580000D03*
X175260000Y-71120000D03*
X175260000Y-73660000D03*
X175260000Y-76200000D03*
%TD*%
D13*
%TO.C,C2*%
X145905000Y-66040000D03*
X144825000Y-66040000D03*
%TD*%
D11*
%TO.C,J4*%
X132080000Y-73660000D03*
D12*
X132080000Y-76200000D03*
%TD*%
D14*
%TO.C,D1*%
X132080000Y-55880000D03*
D15*
X132080000Y-66040000D03*
%TD*%
D13*
%TO.C,C1*%
X138285000Y-66040000D03*
X137205000Y-66040000D03*
%TD*%
D16*
%TO.C,D3*%
X145130000Y-58510000D03*
X148430000Y-58510000D03*
X148430000Y-63410000D03*
X145130000Y-63410000D03*
%TD*%
%TO.C,D2*%
X137510000Y-63410000D03*
X140810000Y-63410000D03*
X140810000Y-58510000D03*
X137510000Y-58510000D03*
%TD*%
D11*
%TO.C,J2*%
X142240000Y-71120000D03*
D12*
X142240000Y-73660000D03*
X142240000Y-76200000D03*
%TD*%
M02*
+57
View File
@@ -0,0 +1,57 @@
%TF.GenerationSoftware,KiCad,Pcbnew,6.0.11+dfsg-1*%
%TF.CreationDate,2025-01-28T23:33:11+01:00*%
%TF.ProjectId,Hanglamp,48616e67-6c61-46d7-902e-6b696361645f,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Paste,Top*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 6.0.11+dfsg-1) date 2025-01-28 23:33:11*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 Aperture macros list*
%AMRoundRect*
0 Rectangle with rounded corners*
0 $1 Rounding radius*
0 $2 $3 $4 $5 $6 $7 $8 $9 X,Y pos of 4 corners*
0 Add a 4 corners polygon primitive as box body*
4,1,4,$2,$3,$4,$5,$6,$7,$8,$9,$2,$3,0*
0 Add four circle primitives for the rounded corners*
1,1,$1+$1,$2,$3*
1,1,$1+$1,$4,$5*
1,1,$1+$1,$6,$7*
1,1,$1+$1,$8,$9*
0 Add four rect primitives between the rounded corners*
20,1,$1+$1,$2,$3,$4,$5,0*
20,1,$1+$1,$4,$5,$6,$7,0*
20,1,$1+$1,$6,$7,$8,$9,0*
20,1,$1+$1,$8,$9,$2,$3,0*%
G04 Aperture macros list end*
%ADD10RoundRect,0.165000X-0.165000X-0.475000X0.165000X-0.475000X0.165000X0.475000X-0.165000X0.475000X0*%
%ADD11R,0.900000X1.500000*%
G04 APERTURE END LIST*
D10*
%TO.C,C2*%
X145905000Y-66040000D03*
X144825000Y-66040000D03*
%TD*%
%TO.C,C1*%
X138285000Y-66040000D03*
X137205000Y-66040000D03*
%TD*%
D11*
%TO.C,D3*%
X145130000Y-58510000D03*
X148430000Y-58510000D03*
X148430000Y-63410000D03*
X145130000Y-63410000D03*
%TD*%
%TO.C,D2*%
X137510000Y-63410000D03*
X140810000Y-63410000D03*
X140810000Y-58510000D03*
X137510000Y-58510000D03*
%TD*%
M02*
+353
View File
@@ -0,0 +1,353 @@
%TF.GenerationSoftware,KiCad,Pcbnew,6.0.11+dfsg-1*%
%TF.CreationDate,2025-01-28T23:33:11+01:00*%
%TF.ProjectId,Hanglamp,48616e67-6c61-46d7-902e-6b696361645f,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Legend,Top*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 6.0.11+dfsg-1) date 2025-01-28 23:33:11*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%ADD10C,0.150000*%
%ADD11C,0.127000*%
%ADD12C,0.120000*%
G04 APERTURE END LIST*
D10*
%TO.C,U1*%
X153543095Y-51839880D02*
X153543095Y-52649404D01*
X153590714Y-52744642D01*
X153638333Y-52792261D01*
X153733571Y-52839880D01*
X153924047Y-52839880D01*
X154019285Y-52792261D01*
X154066904Y-52744642D01*
X154114523Y-52649404D01*
X154114523Y-51839880D01*
X155114523Y-52839880D02*
X154543095Y-52839880D01*
X154828809Y-52839880D02*
X154828809Y-51839880D01*
X154733571Y-51982738D01*
X154638333Y-52077976D01*
X154543095Y-52125595D01*
%TO.C,J3*%
X146986666Y-68242380D02*
X146986666Y-68956666D01*
X146939047Y-69099523D01*
X146843809Y-69194761D01*
X146700952Y-69242380D01*
X146605714Y-69242380D01*
X147367619Y-68242380D02*
X147986666Y-68242380D01*
X147653333Y-68623333D01*
X147796190Y-68623333D01*
X147891428Y-68670952D01*
X147939047Y-68718571D01*
X147986666Y-68813809D01*
X147986666Y-69051904D01*
X147939047Y-69147142D01*
X147891428Y-69194761D01*
X147796190Y-69242380D01*
X147510476Y-69242380D01*
X147415238Y-69194761D01*
X147367619Y-69147142D01*
%TO.C,J1*%
X174926666Y-63162380D02*
X174926666Y-63876666D01*
X174879047Y-64019523D01*
X174783809Y-64114761D01*
X174640952Y-64162380D01*
X174545714Y-64162380D01*
X175926666Y-64162380D02*
X175355238Y-64162380D01*
X175640952Y-64162380D02*
X175640952Y-63162380D01*
X175545714Y-63305238D01*
X175450476Y-63400476D01*
X175355238Y-63448095D01*
%TO.C,C2*%
X145198333Y-67667142D02*
X145150714Y-67714761D01*
X145007857Y-67762380D01*
X144912619Y-67762380D01*
X144769761Y-67714761D01*
X144674523Y-67619523D01*
X144626904Y-67524285D01*
X144579285Y-67333809D01*
X144579285Y-67190952D01*
X144626904Y-67000476D01*
X144674523Y-66905238D01*
X144769761Y-66810000D01*
X144912619Y-66762380D01*
X145007857Y-66762380D01*
X145150714Y-66810000D01*
X145198333Y-66857619D01*
X145579285Y-66857619D02*
X145626904Y-66810000D01*
X145722142Y-66762380D01*
X145960238Y-66762380D01*
X146055476Y-66810000D01*
X146103095Y-66857619D01*
X146150714Y-66952857D01*
X146150714Y-67048095D01*
X146103095Y-67190952D01*
X145531666Y-67762380D01*
X146150714Y-67762380D01*
%TO.C,J4*%
X131746666Y-70782380D02*
X131746666Y-71496666D01*
X131699047Y-71639523D01*
X131603809Y-71734761D01*
X131460952Y-71782380D01*
X131365714Y-71782380D01*
X132651428Y-71115714D02*
X132651428Y-71782380D01*
X132413333Y-70734761D02*
X132175238Y-71449047D01*
X132794285Y-71449047D01*
%TO.C,D1*%
X135502380Y-61698095D02*
X134502380Y-61698095D01*
X134502380Y-61460000D01*
X134550000Y-61317142D01*
X134645238Y-61221904D01*
X134740476Y-61174285D01*
X134930952Y-61126666D01*
X135073809Y-61126666D01*
X135264285Y-61174285D01*
X135359523Y-61221904D01*
X135454761Y-61317142D01*
X135502380Y-61460000D01*
X135502380Y-61698095D01*
X135502380Y-60174285D02*
X135502380Y-60745714D01*
X135502380Y-60460000D02*
X134502380Y-60460000D01*
X134645238Y-60555238D01*
X134740476Y-60650476D01*
X134788095Y-60745714D01*
X134932380Y-56141904D02*
X133932380Y-56141904D01*
X134932380Y-55570476D02*
X134360952Y-55999047D01*
X133932380Y-55570476D02*
X134503809Y-56141904D01*
%TO.C,C1*%
X137578333Y-67667142D02*
X137530714Y-67714761D01*
X137387857Y-67762380D01*
X137292619Y-67762380D01*
X137149761Y-67714761D01*
X137054523Y-67619523D01*
X137006904Y-67524285D01*
X136959285Y-67333809D01*
X136959285Y-67190952D01*
X137006904Y-67000476D01*
X137054523Y-66905238D01*
X137149761Y-66810000D01*
X137292619Y-66762380D01*
X137387857Y-66762380D01*
X137530714Y-66810000D01*
X137578333Y-66857619D01*
X138530714Y-67762380D02*
X137959285Y-67762380D01*
X138245000Y-67762380D02*
X138245000Y-66762380D01*
X138149761Y-66905238D01*
X138054523Y-67000476D01*
X137959285Y-67048095D01*
%TO.C,D3*%
X145232380Y-56618095D02*
X144232380Y-56618095D01*
X144232380Y-56380000D01*
X144280000Y-56237142D01*
X144375238Y-56141904D01*
X144470476Y-56094285D01*
X144660952Y-56046666D01*
X144803809Y-56046666D01*
X144994285Y-56094285D01*
X145089523Y-56141904D01*
X145184761Y-56237142D01*
X145232380Y-56380000D01*
X145232380Y-56618095D01*
X144232380Y-55713333D02*
X144232380Y-55094285D01*
X144613333Y-55427619D01*
X144613333Y-55284761D01*
X144660952Y-55189523D01*
X144708571Y-55141904D01*
X144803809Y-55094285D01*
X145041904Y-55094285D01*
X145137142Y-55141904D01*
X145184761Y-55189523D01*
X145232380Y-55284761D01*
X145232380Y-55570476D01*
X145184761Y-55665714D01*
X145137142Y-55713333D01*
X146502380Y-60674285D02*
X146502380Y-61245714D01*
X146502380Y-60960000D02*
X145502380Y-60960000D01*
X145645238Y-61055238D01*
X145740476Y-61150476D01*
X145788095Y-61245714D01*
%TO.C,D2*%
X137612380Y-56618095D02*
X136612380Y-56618095D01*
X136612380Y-56380000D01*
X136660000Y-56237142D01*
X136755238Y-56141904D01*
X136850476Y-56094285D01*
X137040952Y-56046666D01*
X137183809Y-56046666D01*
X137374285Y-56094285D01*
X137469523Y-56141904D01*
X137564761Y-56237142D01*
X137612380Y-56380000D01*
X137612380Y-56618095D01*
X136707619Y-55665714D02*
X136660000Y-55618095D01*
X136612380Y-55522857D01*
X136612380Y-55284761D01*
X136660000Y-55189523D01*
X136707619Y-55141904D01*
X136802857Y-55094285D01*
X136898095Y-55094285D01*
X137040952Y-55141904D01*
X137612380Y-55713333D01*
X137612380Y-55094285D01*
X138882380Y-60674285D02*
X138882380Y-61245714D01*
X138882380Y-60960000D02*
X137882380Y-60960000D01*
X138025238Y-61055238D01*
X138120476Y-61150476D01*
X138168095Y-61245714D01*
%TO.C,J2*%
X139366666Y-73112380D02*
X139366666Y-73826666D01*
X139319047Y-73969523D01*
X139223809Y-74064761D01*
X139080952Y-74112380D01*
X138985714Y-74112380D01*
X139795238Y-73207619D02*
X139842857Y-73160000D01*
X139938095Y-73112380D01*
X140176190Y-73112380D01*
X140271428Y-73160000D01*
X140319047Y-73207619D01*
X140366666Y-73302857D01*
X140366666Y-73398095D01*
X140319047Y-73540952D01*
X139747619Y-74112380D01*
X140366666Y-74112380D01*
D11*
%TO.C,U1*%
X169020000Y-54690000D02*
X164520000Y-54690000D01*
X169020000Y-77390000D02*
X169020000Y-54690000D01*
X155520000Y-53390000D02*
X155520000Y-54690000D01*
X164520000Y-53390000D02*
X164520000Y-54690000D01*
X151020000Y-77390000D02*
X151020000Y-54690000D01*
X169020000Y-77390000D02*
X151020000Y-77390000D01*
X164520000Y-53390000D02*
X155520000Y-53390000D01*
X155520000Y-54690000D02*
X151020000Y-54690000D01*
D12*
%TO.C,J3*%
X145990000Y-72390000D02*
X148650000Y-72390000D01*
X145990000Y-72390000D02*
X145990000Y-77530000D01*
X145990000Y-77530000D02*
X148650000Y-77530000D01*
X145990000Y-71120000D02*
X145990000Y-69790000D01*
X148650000Y-72390000D02*
X148650000Y-77530000D01*
X145990000Y-69790000D02*
X147320000Y-69790000D01*
%TO.C,J1*%
X173930000Y-64710000D02*
X175260000Y-64710000D01*
X173930000Y-77530000D02*
X176590000Y-77530000D01*
X173930000Y-67310000D02*
X176590000Y-67310000D01*
X176590000Y-67310000D02*
X176590000Y-77530000D01*
X173930000Y-66040000D02*
X173930000Y-64710000D01*
X173930000Y-67310000D02*
X173930000Y-77530000D01*
%TO.C,J4*%
X130750000Y-74930000D02*
X130750000Y-77530000D01*
X130750000Y-77530000D02*
X133410000Y-77530000D01*
X130750000Y-72330000D02*
X132080000Y-72330000D01*
X130750000Y-74930000D02*
X133410000Y-74930000D01*
X133410000Y-74930000D02*
X133410000Y-77530000D01*
X130750000Y-73660000D02*
X130750000Y-72330000D01*
%TO.C,D1*%
X130440000Y-56390000D02*
X130110000Y-56390000D01*
X133720000Y-56390000D02*
X134050000Y-56390000D01*
X130110000Y-65530000D02*
X130440000Y-65530000D01*
X134050000Y-57965000D02*
X130110000Y-57965000D01*
X134050000Y-57845000D02*
X130110000Y-57845000D01*
X134050000Y-65530000D02*
X133720000Y-65530000D01*
X130110000Y-56390000D02*
X130110000Y-65530000D01*
X134050000Y-56390000D02*
X134050000Y-65530000D01*
X134050000Y-57725000D02*
X130110000Y-57725000D01*
%TO.C,D3*%
X149530000Y-64610000D02*
X149530000Y-57310000D01*
X149530000Y-57310000D02*
X148380000Y-57310000D01*
X144030000Y-64610000D02*
X144030000Y-57310000D01*
%TO.C,D2*%
X141910000Y-57310000D02*
X140760000Y-57310000D01*
X136410000Y-64610000D02*
X136410000Y-57310000D01*
X141910000Y-64610000D02*
X141910000Y-57310000D01*
%TO.C,J2*%
X140910000Y-69790000D02*
X142240000Y-69790000D01*
X140910000Y-72390000D02*
X143570000Y-72390000D01*
X143570000Y-72390000D02*
X143570000Y-77530000D01*
X140910000Y-77530000D02*
X143570000Y-77530000D01*
X140910000Y-72390000D02*
X140910000Y-77530000D01*
X140910000Y-71120000D02*
X140910000Y-69790000D01*
%TD*%
M02*
+13
View File
@@ -0,0 +1,13 @@
M48
; DRILL file {KiCad 6.0.11+dfsg-1} date Tue 28 Jan 2025 11:33:07 PM CET
; FORMAT={-:-/ absolute / metric / decimal}
; #@! TF.CreationDate,2025-01-28T23:33:07+01:00
; #@! TF.GenerationSoftware,Kicad,Pcbnew,6.0.11+dfsg-1
; #@! TF.FileFunction,NonPlated,1,2,NPTH
FMAT,2
METRIC
%
G90
G05
T0
M30
+60
View File
@@ -0,0 +1,60 @@
M48
; DRILL file {KiCad 6.0.11+dfsg-1} date Tue 28 Jan 2025 11:33:07 PM CET
; FORMAT={-:-/ absolute / metric / decimal}
; #@! TF.CreationDate,2025-01-28T23:33:07+01:00
; #@! TF.GenerationSoftware,Kicad,Pcbnew,6.0.11+dfsg-1
; #@! TF.FileFunction,Plated,1,2,PTH
FMAT,2
METRIC
; #@! TA.AperFunction,Plated,PTH,ViaDrill
T1C0.400
; #@! TA.AperFunction,Plated,PTH,ComponentDrill
T2C1.000
; #@! TA.AperFunction,Plated,PTH,ComponentDrill
T3C1.270
; #@! TA.AperFunction,Plated,PTH,ComponentDrill
T4C1.400
%
G90
G05
T1
X139.115Y-63.424
X139.7Y-58.42
X146.721Y-63.365
X147.32Y-58.42
T2
X132.08Y-73.66
X132.08Y-76.2
X142.24Y-71.12
X142.24Y-73.66
X142.24Y-76.2
X147.32Y-71.12
X147.32Y-73.66
X147.32Y-76.2
X175.26Y-66.04
X175.26Y-68.58
X175.26Y-71.12
X175.26Y-73.66
X175.26Y-76.2
T3
X152.4Y-56.14
X152.4Y-58.68
X152.4Y-61.22
X152.4Y-63.76
X152.4Y-66.3
X152.4Y-68.84
X152.4Y-71.38
X152.4Y-73.92
X167.64Y-56.14
X167.64Y-58.68
X167.64Y-61.22
X167.64Y-63.76
X167.64Y-66.3
X167.64Y-68.84
X167.64Y-71.38
X167.64Y-73.92
T4
X132.08Y-55.88
X132.08Y-66.04
T0
M30
+127
View File
@@ -0,0 +1,127 @@
{
"Header": {
"GenerationSoftware": {
"Vendor": "KiCad",
"Application": "Pcbnew",
"Version": "6.0.11+dfsg-1"
},
"CreationDate": "2025-01-28T23:33:11+01:00"
},
"GeneralSpecs": {
"ProjectId": {
"Name": "Hanglamp",
"GUID": "48616e67-6c61-46d7-902e-6b696361645f",
"Revision": "rev?"
},
"Size": {
"X": 48.36,
"Y": 25.5
},
"LayerNumber": 2,
"BoardThickness": 1.6,
"Finish": "None"
},
"DesignRules": [
{
"Layers": "Outer",
"PadToPad": 0.2,
"PadToTrack": 0.2,
"TrackToTrack": 0.2,
"MinLineWidth": 0.25,
"TrackToRegion": 0.508,
"RegionToRegion": 0.508
}
],
"FilesAttributes": [
{
"Path": "Hanglamp-F_Cu.gbr",
"FileFunction": "Copper,L1,Top",
"FilePolarity": "Positive"
},
{
"Path": "Hanglamp-B_Cu.gbr",
"FileFunction": "Copper,L2,Bot",
"FilePolarity": "Positive"
},
{
"Path": "Hanglamp-F_Paste.gbr",
"FileFunction": "SolderPaste,Top",
"FilePolarity": "Positive"
},
{
"Path": "Hanglamp-B_Paste.gbr",
"FileFunction": "SolderPaste,Bot",
"FilePolarity": "Positive"
},
{
"Path": "Hanglamp-F_Silkscreen.gbr",
"FileFunction": "Legend,Top",
"FilePolarity": "Positive"
},
{
"Path": "Hanglamp-B_Silkscreen.gbr",
"FileFunction": "Legend,Bot",
"FilePolarity": "Positive"
},
{
"Path": "Hanglamp-F_Mask.gbr",
"FileFunction": "SolderMask,Top",
"FilePolarity": "Negative"
},
{
"Path": "Hanglamp-B_Mask.gbr",
"FileFunction": "SolderMask,Bot",
"FilePolarity": "Negative"
},
{
"Path": "Hanglamp-Edge_Cuts.gbr",
"FileFunction": "Profile",
"FilePolarity": "Positive"
}
],
"MaterialStackup": [
{
"Type": "Legend",
"Name": "Top Silk Screen"
},
{
"Type": "SolderPaste",
"Name": "Top Solder Paste"
},
{
"Type": "SolderMask",
"Thickness": 0.01,
"Name": "Top Solder Mask"
},
{
"Type": "Copper",
"Thickness": 0.035,
"Name": "F.Cu"
},
{
"Type": "Dielectric",
"Thickness": 1.51,
"Material": "FR4",
"Name": "F.Cu/B.Cu",
"Notes": "Type: dielectric layer 1 (from F.Cu to B.Cu)"
},
{
"Type": "Copper",
"Thickness": 0.035,
"Name": "B.Cu"
},
{
"Type": "SolderMask",
"Thickness": 0.01,
"Name": "Bottom Solder Mask"
},
{
"Type": "SolderPaste",
"Name": "Bottom Solder Paste"
},
{
"Type": "Legend",
"Name": "Bottom Silk Screen"
}
]
}
File diff suppressed because it is too large Load Diff
+75
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": "Hanglamp.kicad_prl",
"version": 3
},
"project": {
"files": []
}
}
+455
View File
@@ -0,0 +1,455 @@
{
"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.39999999999999997,
"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.25,
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": "Hanglamp.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
},
{
"bus_width": 12.0,
"clearance": 0.4,
"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": "Power",
"nets": [
"+5V"
],
"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": "KiCad",
"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": [
[
"b1b9fff3-73b3-4638-b03f-be42f313d005",
""
]
],
"text_variables": {}
}
File diff suppressed because it is too large Load Diff
+313
View File
@@ -0,0 +1,313 @@
(export (version "E")
(design
(source "/home/daan/dev/hanglamp/hardware/Hanglamp/Hanglamp.kicad_sch")
(date "Tue 28 Jan 2025 10:55:36 PM CET")
(tool "Eeschema 6.0.11+dfsg-1")
(sheet (number "1") (name "/") (tstamps "/")
(title_block
(title)
(company)
(rev)
(date)
(source "Hanglamp.kicad_sch")
(comment (number "1") (value ""))
(comment (number "2") (value ""))
(comment (number "3") (value ""))
(comment (number "4") (value ""))
(comment (number "5") (value ""))
(comment (number "6") (value ""))
(comment (number "7") (value ""))
(comment (number "8") (value ""))
(comment (number "9") (value "")))))
(components
(comp (ref "C1")
(value "C")
(footprint "Capacitor_SMD:C_0504_1310Metric")
(libsource (lib "Device") (part "C") (description "Unpolarized capacitor"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "Hanglamp.kicad_sch"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "26e5fcde-ff24-4eee-b618-b93f87b175cd"))
(comp (ref "C2")
(value "C")
(footprint "Capacitor_SMD:C_0504_1310Metric")
(libsource (lib "Device") (part "C") (description "Unpolarized capacitor"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "Hanglamp.kicad_sch"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "0045cad5-fb4e-434f-8df3-361f842e5880"))
(comp (ref "D1")
(value "DIODE")
(footprint "Diode_THT:D_5W_P10.16mm_Horizontal")
(libsource (lib "pspice") (part "DIODE") (description "Diode symbol for simulation only. Pin order incompatible with official kicad footprints"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "Hanglamp.kicad_sch"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "ff09fb9d-8ab4-4457-9181-718324fa7db1"))
(comp (ref "D2")
(value "WS2812B")
(footprint "LED_SMD:LED_WS2812B_PLCC4_5.0x5.0mm_P3.2mm")
(datasheet "https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf")
(libsource (lib "LED") (part "WS2812B") (description "RGB LED with integrated controller"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "Hanglamp.kicad_sch"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "207a6b00-255d-4b32-87a5-ecc1fe23ee5a"))
(comp (ref "D3")
(value "WS2812B")
(footprint "LED_SMD:LED_WS2812B_PLCC4_5.0x5.0mm_P3.2mm")
(datasheet "https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf")
(libsource (lib "LED") (part "WS2812B") (description "RGB LED with integrated controller"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "Hanglamp.kicad_sch"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "d5737210-ffc2-4478-b164-64202cd21042"))
(comp (ref "J1")
(value "CONN_ROT_ENC")
(footprint "Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_Vertical")
(libsource (lib "Connector_Generic") (part "Conn_01x05") (description "Generic connector, single row, 01x05, script generated (kicad-library-utils/schlib/autogen/connector/)"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "Hanglamp.kicad_sch"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "a0c3753c-e3fe-4a33-ac41-016f293f037f"))
(comp (ref "J2")
(value "Conn_01x03")
(footprint "Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical")
(libsource (lib "Connector_Generic") (part "Conn_01x03") (description "Generic connector, single row, 01x03, script generated (kicad-library-utils/schlib/autogen/connector/)"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "Hanglamp.kicad_sch"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "e677dc3d-9f7e-434e-9f30-654dfb6badae"))
(comp (ref "J3")
(value "Conn_01x03")
(footprint "Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical")
(libsource (lib "Connector_Generic") (part "Conn_01x03") (description "Generic connector, single row, 01x03, script generated (kicad-library-utils/schlib/autogen/connector/)"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "Hanglamp.kicad_sch"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "d2b05e5e-0ba6-4f7d-9203-efef3ec5b7f7"))
(comp (ref "J4")
(value "Conn_01x02")
(footprint "Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical")
(libsource (lib "Connector_Generic") (part "Conn_01x02") (description "Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "Hanglamp.kicad_sch"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "e7d2da4b-3d2c-4100-8e44-f31bd455bcd2"))
(comp (ref "U1")
(value "ESP32-C3_SUPERMINI_TH")
(footprint "esp32-c3:MODULE_ESP32-C3_SUPERMINI")
(fields
(field (name "Availability") "Not in stock")
(field (name "Check_prices") "https://www.snapeda.com/parts/ESP32-C3%20SuperMini_TH/Espressif+Systems/view-part/?ref=eda")
(field (name "Description") "\n \n Super tiny ESP32-C3 board\n \n")
(field (name "MANUFACTURER") "Espressif")
(field (name "MAXIMUM_PACKAGE_HEIGHT") "4.2mm")
(field (name "MF") "Espressif Systems")
(field (name "MP") "ESP32-C3 SuperMini_TH")
(field (name "Package") "Package")
(field (name "Price") "None")
(field (name "STANDARD") "Manufacturer Recommendations")
(field (name "SnapEDA_Link") "https://www.snapeda.com/parts/ESP32-C3%20SuperMini_TH/Espressif+Systems/view-part/?ref=snap"))
(libsource (lib "ESP32-C3_SUPERMINI_TH") (part "ESP32-C3_SUPERMINI_TH") (description ""))
(property (name "MF") (value "Espressif Systems"))
(property (name "MAXIMUM_PACKAGE_HEIGHT") (value "4.2mm"))
(property (name "Package") (value "Package"))
(property (name "Price") (value "None"))
(property (name "Check_prices") (value "https://www.snapeda.com/parts/ESP32-C3%20SuperMini_TH/Espressif+Systems/view-part/?ref=eda"))
(property (name "STANDARD") (value "Manufacturer Recommendations"))
(property (name "PARTREV") (value ""))
(property (name "SnapEDA_Link") (value "https://www.snapeda.com/parts/ESP32-C3%20SuperMini_TH/Espressif+Systems/view-part/?ref=snap"))
(property (name "MP") (value "ESP32-C3 SuperMini_TH"))
(property (name "Description") (value "\n \n Super tiny ESP32-C3 board\n \n"))
(property (name "Availability") (value "Not in stock"))
(property (name "MANUFACTURER") (value "Espressif"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "Hanglamp.kicad_sch"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "baa94b6d-0132-4b29-ab80-540162a717d7")))
(libparts
(libpart (lib "Connector_Generic") (part "Conn_01x02")
(description "Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)")
(docs "~")
(footprints
(fp "Connector*:*_1x??_*"))
(fields
(field (name "Reference") "J")
(field (name "Value") "Conn_01x02")
(field (name "Datasheet") "~"))
(pins
(pin (num "1") (name "Pin_1") (type "passive"))
(pin (num "2") (name "Pin_2") (type "passive"))))
(libpart (lib "Connector_Generic") (part "Conn_01x03")
(description "Generic connector, single row, 01x03, script generated (kicad-library-utils/schlib/autogen/connector/)")
(docs "~")
(footprints
(fp "Connector*:*_1x??_*"))
(fields
(field (name "Reference") "J")
(field (name "Value") "Conn_01x03")
(field (name "Datasheet") "~"))
(pins
(pin (num "1") (name "Pin_1") (type "passive"))
(pin (num "2") (name "Pin_2") (type "passive"))
(pin (num "3") (name "Pin_3") (type "passive"))))
(libpart (lib "Connector_Generic") (part "Conn_01x05")
(description "Generic connector, single row, 01x05, script generated (kicad-library-utils/schlib/autogen/connector/)")
(docs "~")
(footprints
(fp "Connector*:*_1x??_*"))
(fields
(field (name "Reference") "J")
(field (name "Value") "Conn_01x05")
(field (name "Datasheet") "~"))
(pins
(pin (num "1") (name "Pin_1") (type "passive"))
(pin (num "2") (name "Pin_2") (type "passive"))
(pin (num "3") (name "Pin_3") (type "passive"))
(pin (num "4") (name "Pin_4") (type "passive"))
(pin (num "5") (name "Pin_5") (type "passive"))))
(libpart (lib "Device") (part "C")
(description "Unpolarized capacitor")
(docs "~")
(footprints
(fp "C_*"))
(fields
(field (name "Reference") "C")
(field (name "Value") "C")
(field (name "Datasheet") "~"))
(pins
(pin (num "1") (name "") (type "passive"))
(pin (num "2") (name "") (type "passive"))))
(libpart (lib "ESP32-C3_SUPERMINI_TH") (part "ESP32-C3_SUPERMINI_TH")
(fields
(field (name "Reference") "U")
(field (name "Value") "ESP32-C3_SUPERMINI_TH")
(field (name "Footprint") "ESP32-C3_SUPERMINI_TH:MODULE_ESP32-C3_SUPERMINI")
(field (name "MF") "Espressif Systems")
(field (name "MAXIMUM_PACKAGE_HEIGHT") "4.2mm")
(field (name "Package") "Package")
(field (name "Price") "None")
(field (name "Check_prices") "https://www.snapeda.com/parts/ESP32-C3%20SuperMini_TH/Espressif+Systems/view-part/?ref=eda")
(field (name "STANDARD") "Manufacturer Recommendations")
(field (name "SnapEDA_Link") "https://www.snapeda.com/parts/ESP32-C3%20SuperMini_TH/Espressif+Systems/view-part/?ref=snap")
(field (name "MP") "ESP32-C3 SuperMini_TH")
(field (name "Description") "\n \n Super tiny ESP32-C3 board\n \n")
(field (name "Availability") "Not in stock")
(field (name "MANUFACTURER") "Espressif"))
(pins
(pin (num "0") (name "GPIO0") (type "bidirectional"))
(pin (num "1") (name "GPIO1") (type "bidirectional"))
(pin (num "2") (name "GPIO2") (type "bidirectional"))
(pin (num "3") (name "GPIO3") (type "bidirectional"))
(pin (num "3.3") (name "3V3") (type "power_in"))
(pin (num "4") (name "GPIO4") (type "bidirectional"))
(pin (num "5") (name "GPIO5") (type "bidirectional"))
(pin (num "5V") (name "5V") (type "power_in"))
(pin (num "6") (name "GPIO6") (type "bidirectional"))
(pin (num "7") (name "GPIO7") (type "bidirectional"))
(pin (num "8") (name "GPIO8") (type "bidirectional"))
(pin (num "9") (name "GPIO9") (type "bidirectional"))
(pin (num "10") (name "GPIO10") (type "bidirectional"))
(pin (num "20") (name "GPIO20") (type "bidirectional"))
(pin (num "21") (name "GPIO21") (type "bidirectional"))
(pin (num "G") (name "GND") (type "power_in"))))
(libpart (lib "LED") (part "WS2812B")
(description "RGB LED with integrated controller")
(docs "https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf")
(footprints
(fp "LED*WS2812*PLCC*5.0x5.0mm*P3.2mm*"))
(fields
(field (name "Reference") "D")
(field (name "Value") "WS2812B")
(field (name "Footprint") "LED_SMD:LED_WS2812B_PLCC4_5.0x5.0mm_P3.2mm")
(field (name "Datasheet") "https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf"))
(pins
(pin (num "1") (name "VDD") (type "power_in"))
(pin (num "2") (name "DOUT") (type "output"))
(pin (num "3") (name "VSS") (type "power_in"))
(pin (num "4") (name "DIN") (type "input"))))
(libpart (lib "pspice") (part "DIODE")
(description "Diode symbol for simulation only. Pin order incompatible with official kicad footprints")
(docs "~")
(fields
(field (name "Reference") "D")
(field (name "Value") "DIODE")
(field (name "Datasheet") "~"))
(pins
(pin (num "1") (name "K") (type "input"))
(pin (num "2") (name "A") (type "input")))))
(libraries
(library (logical "Connector_Generic")
(uri "/usr/share/kicad/symbols//Connector_Generic.kicad_sym"))
(library (logical "Device")
(uri "/usr/share/kicad/symbols//Device.kicad_sym"))
(library (logical "ESP32-C3_SUPERMINI_TH")
(uri "/home/daan/Downloads/esp32-c3/ESP32-C3_SUPERMINI_TH.kicad_sym"))
(library (logical "LED")
(uri "/usr/share/kicad/symbols//LED.kicad_sym"))
(library (logical "pspice")
(uri "/usr/share/kicad/symbols//pspice.kicad_sym")))
(nets
(net (code "1") (name "+3.3V")
(node (ref "J1") (pin "5") (pinfunction "Pin_5") (pintype "passive"))
(node (ref "U1") (pin "3.3") (pinfunction "3V3") (pintype "power_in")))
(net (code "2") (name "+4V")
(node (ref "C1") (pin "1") (pintype "passive"))
(node (ref "C2") (pin "1") (pintype "passive"))
(node (ref "D1") (pin "2") (pinfunction "A") (pintype "input"))
(node (ref "D2") (pin "1") (pinfunction "VDD") (pintype "power_in"))
(node (ref "D3") (pin "1") (pinfunction "VDD") (pintype "power_in")))
(net (code "3") (name "+5V")
(node (ref "D1") (pin "1") (pinfunction "K") (pintype "input"))
(node (ref "J3") (pin "1") (pinfunction "Pin_1") (pintype "passive"))
(node (ref "J3") (pin "2") (pinfunction "Pin_2") (pintype "passive"))
(node (ref "J3") (pin "3") (pinfunction "Pin_3") (pintype "passive"))
(node (ref "U1") (pin "5V") (pinfunction "5V") (pintype "power_in")))
(net (code "4") (name "GND")
(node (ref "C1") (pin "2") (pintype "passive"))
(node (ref "C2") (pin "2") (pintype "passive"))
(node (ref "D2") (pin "3") (pinfunction "VSS") (pintype "power_in"))
(node (ref "D3") (pin "3") (pinfunction "VSS") (pintype "power_in"))
(node (ref "J1") (pin "1") (pinfunction "Pin_1") (pintype "passive"))
(node (ref "J2") (pin "1") (pinfunction "Pin_1") (pintype "passive"))
(node (ref "J2") (pin "2") (pinfunction "Pin_2") (pintype "passive"))
(node (ref "J2") (pin "3") (pinfunction "Pin_3") (pintype "passive"))
(node (ref "U1") (pin "G") (pinfunction "GND") (pintype "power_in")))
(net (code "5") (name "GPIO5")
(node (ref "D2") (pin "4") (pinfunction "DIN") (pintype "input"))
(node (ref "U1") (pin "5") (pinfunction "GPIO5") (pintype "bidirectional")))
(net (code "6") (name "GPIO6")
(node (ref "D3") (pin "4") (pinfunction "DIN") (pintype "input"))
(node (ref "U1") (pin "6") (pinfunction "GPIO6") (pintype "bidirectional")))
(net (code "7") (name "Net-(J1-Pad2)")
(node (ref "J1") (pin "2") (pinfunction "Pin_2") (pintype "passive"))
(node (ref "U1") (pin "2") (pinfunction "GPIO2") (pintype "bidirectional")))
(net (code "8") (name "Net-(J1-Pad3)")
(node (ref "J1") (pin "3") (pinfunction "Pin_3") (pintype "passive"))
(node (ref "U1") (pin "1") (pinfunction "GPIO1") (pintype "bidirectional")))
(net (code "9") (name "Net-(J1-Pad4)")
(node (ref "J1") (pin "4") (pinfunction "Pin_4") (pintype "passive"))
(node (ref "U1") (pin "0") (pinfunction "GPIO0") (pintype "bidirectional")))
(net (code "10") (name "STRIP1")
(node (ref "D2") (pin "2") (pinfunction "DOUT") (pintype "output"))
(node (ref "J4") (pin "1") (pinfunction "Pin_1") (pintype "passive")))
(net (code "11") (name "STRIP2")
(node (ref "D3") (pin "2") (pinfunction "DOUT") (pintype "output"))
(node (ref "J4") (pin "2") (pinfunction "Pin_2") (pintype "passive")))
(net (code "12") (name "unconnected-(U1-Pad3)")
(node (ref "U1") (pin "3") (pinfunction "GPIO3") (pintype "bidirectional")))
(net (code "13") (name "unconnected-(U1-Pad4)")
(node (ref "U1") (pin "4") (pinfunction "GPIO4") (pintype "bidirectional")))
(net (code "14") (name "unconnected-(U1-Pad7)")
(node (ref "U1") (pin "7") (pinfunction "GPIO7") (pintype "bidirectional")))
(net (code "15") (name "unconnected-(U1-Pad8)")
(node (ref "U1") (pin "8") (pinfunction "GPIO8") (pintype "bidirectional")))
(net (code "16") (name "unconnected-(U1-Pad9)")
(node (ref "U1") (pin "9") (pinfunction "GPIO9") (pintype "bidirectional")))
(net (code "17") (name "unconnected-(U1-Pad10)")
(node (ref "U1") (pin "10") (pinfunction "GPIO10") (pintype "bidirectional")))
(net (code "18") (name "unconnected-(U1-Pad20)")
(node (ref "U1") (pin "20") (pinfunction "GPIO20") (pintype "bidirectional")))
(net (code "19") (name "unconnected-(U1-Pad21)")
(node (ref "U1") (pin "21") (pinfunction "GPIO21") (pintype "bidirectional")))))
File diff suppressed because it is too large Load Diff
+11 -13
View File
@@ -29,6 +29,7 @@ lib_deps =
devyte/ESPAsyncDNSServer@^1.0.0
me-no-dev/ESPAsyncUDP
makuna/NeoPixelBus @ ^2.8.0
knolleary/PubSubClient@^2.8
lib_ldf_mode = chain+
monitor_filters =
default
@@ -37,22 +38,19 @@ board_build.filesystem = littlefs
board_build.f_cpu = 80000000L
[env:esp32c3_supermini]
; platform = espressif32
; board = esp32-c3-devkitm-1
; platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5
; board = lolin_c3_mini
board = dfrobot_beetle_esp32c3
platform = espressif32
framework = arduino
monitor_speed = 460800
monitor_speed = 115200
monitor_filters =
esp32_exception_decoder
time
lib_deps =
fastled/FastLED@^3.7.0
knolleary/PubSubClient@^2.8
; [env:dfrobot_beetle_esp32c3]
; platform = espressif32
; board = dfrobot_beetle_esp32c3
; framework = arduino
; lib_deps =
; fastled/FastLED@^3.7.0
[env:esp32c3_supermini_network]
extends = env:esp32c3_supermini
upload_protocol = espota
upload_port = 10.206.0.101
+150
View File
@@ -0,0 +1,150 @@
#include "Controls.h"
uint8_t controlPins[] = {
PIN_A,
PIN_B,
PIN_KEY,
};
uint16_t thresholds[] = {
2048,
1000,
3072,
};
uint16_t prevState[3];
uint8_t controlPinCount = sizeof(controlPins) / sizeof(controlPins[0]);
auto lastChange = micros();
uint8_t pinChanges[128];
uint8_t pinChangeIndex = 0;
void Controls_direction_reset(){
lastChange = 0;
pinChangeIndex = 0;
}
auto lastKey = micros();
ControlsCallback handler = NULL;
void Controls_handler(ControlsCallback newHandler){
handler = newHandler;
}
void Controls_send_event(ControlEvent event){
if(handler){
handler(event);
}
}
void Controls_loop(void *pvParameters){
lastKey = 0;
lastChange = 0;
while(true){
for(uint8_t a=0; a<controlPinCount; a++){
auto pin = controlPins[a];
auto currentValueAnalog = analogRead(pin);
auto currentValue = currentValueAnalog > thresholds[a];
auto prevValue = prevState[a];
if(CONTROLS_DEBUG > 200){
Serial.printf("Pin %d: %d->%d (%d)\n", pin, prevValue, currentValue, currentValueAnalog);
}
// if(abs(currentValue - prevValue) > 100){
if(currentValue != prevValue){
if(CONTROLS_DEBUG > 100){
Serial.printf("Change on pin %d: %d -> %d (%d)\n", pin, prevValue, currentValue, currentValueAnalog);
}
if(pin == PIN_KEY){
if(currentValue){
auto duration = micros() - lastKey;
if(duration > KEY_DURATION_MS * 1000){
if(CONTROLS_DEBUG > 10){
Serial.printf("Key: %d\n", duration);
}
Controls_send_event({Key, (int)duration});
}else{
if(CONTROLS_DEBUG > 20){
Serial.println("Too short");
}
}
lastKey = 0;
} else {
lastKey = micros();
}
}else{
pinChanges[pinChangeIndex++] = pin;
lastChange = micros();
}
}
prevState[a] = currentValue;
}
//maybe we have a valid sequence
if(pinChangeIndex >= 4){
// Serial.printf("Have %d changes\n", pinChangeIndex);
for(uint8_t base = 0; base + 4 <= pinChangeIndex; base += 4){
if(
pinChanges[base + 0] == PIN_A &&
pinChanges[base + 1] == PIN_B &&
pinChanges[base + 2] == PIN_A &&
pinChanges[base + 3] == PIN_B
){
if(CONTROLS_DEBUG > 10){
Serial.println("Dir A");
}
Controls_send_event({Counterclockwise, NULL});
}else if(
pinChanges[base + 0] == PIN_B &&
pinChanges[base + 1] == PIN_A &&
pinChanges[base + 2] == PIN_B &&
pinChanges[base + 3] == PIN_A
){
if(CONTROLS_DEBUG > 10){
Serial.println("Dir B");
}
Controls_send_event({Clockwise, NULL});
}else{
if(CONTROLS_DEBUG > 20){
Serial.println("Unknown direction");
Serial.printf("[%d, %d, %d, %d]\n", pinChanges[base + 0], pinChanges[base + 1], pinChanges[base + 2], pinChanges[base + 3]);
}
}
}
Controls_direction_reset();
}
if(lastChange){
if(micros() - lastChange > 100 * 1000){
if(CONTROLS_DEBUG > 100){
Serial.println("changes expired");
}
Controls_direction_reset();
}
}
vTaskDelay(2/portTICK_PERIOD_MS);
}
}
void Controls_setup(){
pinMode(PIN_A, INPUT_PULLDOWN);
pinMode(PIN_B, INPUT_PULLDOWN);
pinMode(PIN_KEY, INPUT_PULLDOWN);
TaskHandle_t taskControls = NULL;
xTaskCreate(Controls_loop, "Controls_loop", 2048, NULL, tskIDLE_PRIORITY, &taskControls);
}
+31
View File
@@ -0,0 +1,31 @@
#pragma once
#include "config.h"
#include <Arduino.h>
#define PIN_A 1
#define PIN_B 0
#define PIN_KEY 2
#define KEY_DURATION_MS 150
#define CONTROLS_DEBUG 1
enum ControlEventType {
Clockwise,
Counterclockwise,
Key
};
struct ControlEvent {
ControlEventType type;
int data;
};
typedef void (* ControlsCallback)( ControlEvent ) ;
void Controls_setup();
void Controls_handler(ControlsCallback callback);
+174 -209
View File
@@ -1,234 +1,199 @@
#define INCLUDE_LED
#ifdef INCLUDE_LED
#include "Led.h"
#endif
#include <Arduino.h>
#define _TASK_SLEEP_ON_IDLE_RUN // Enable 1 ms SLEEP_IDLE powerdowns between runs if no callback methods were invoked during the pass
#define _TASK_STATUS_REQUEST // Compile with support for StatusRequest functionality - triggering tasks on status change events in addition to time only
// #define ENABLE_MQTT
// #define ENABLE_WIFI
// #define ENABLE_FS
// #define ENABLE_PINFINDER
// #include <TaskScheduler.h>
#ifdef ENABLE_MQTT
#include "MQTT.h"
#endif
#ifdef ENABLE_WIFI
#include "Wifi.h"
#endif
#ifdef ENABLE_FS
#include "FS.h"
#include <LittleFS.h>
#endif
#ifdef ENABLE_PINFINDER
#include "PinFinder.h"
#endif
#include "Hanglamp.hpp"
void feedWatchdog(){
// ESP.wdtFeed();
}
bool blinkStatus = false;
void blink(){
blinkStatus = !blinkStatus;
digitalWrite(LED_BUILTIN, blinkStatus);
}
#ifdef INCLUDE_LED
CRGB colorTable[] = {
CRGB(255, 142, 32), // "warm wit"
// CRGB(255, 100, 4),
// CRGB(255, 128, 4),
// CRGB(255, 100, 32),
// CRGB(255, 128, 32),
CRGB::White,
CRGB::Red,
CRGB::Blue,
CRGB::Green,
CRGB::Purple,
CRGB::Turquoise,
CRGB::Yellow,
CRGB::Red,
CRGB::Blue,
CRGB::Green,
CRGB::Purple,
CRGB::Turquoise,
CRGB::Yellow,
CRGB::Red,
CRGB::Blue,
CRGB::Green,
CRGB::Purple,
CRGB::Turquoise,
CRGB::Yellow,
CRGB::Red,
CRGB::Blue,
CRGB::Green,
CRGB::Purple,
CRGB::Turquoise,
CRGB::Yellow,
CRGB::Red,
CRGB::Blue,
CRGB::Green,
CRGB::Purple,
CRGB::Turquoise,
CRGB::Yellow,
CRGB::Red,
CRGB::Blue,
CRGB::Green,
CRGB::Purple,
CRGB::Turquoise,
CRGB::Yellow,
CRGB::Red,
CRGB::Blue,
CRGB::Green,
CRGB::Purple,
CRGB::Turquoise,
CRGB::Yellow,
CRGB::Red,
CRGB::Blue,
CRGB::Green,
CRGB::Purple,
CRGB::Turquoise,
CRGB::Yellow,
};
uint8_t colorIndex = 0;
void colors(){
colorIndex++;
Hanglamp::Hanglamp(){
}
void parseHexColor(const String& hexColor, uint8_t& r, uint8_t& g, uint8_t& b) {
String cleanHex = hexColor;
// Remove leading '#' if present
if (cleanHex.startsWith("#")) {
cleanHex = cleanHex.substring(1);
}
// Make sure it's exactly 6 characters
if (cleanHex.length() != 6) {
r = g = b = 0; // default/fallback
return;
}
// Parse the color components
r = strtoul(cleanHex.substring(0, 2).c_str(), NULL, 16);
g = strtoul(cleanHex.substring(2, 4).c_str(), NULL, 16);
b = strtoul(cleanHex.substring(4, 6).c_str(), NULL, 16);
}
void Hanglamp::setup(){
#ifdef ENABLE_MQTT
MQTT_subscribe("hanglamp/CMD/brightness", [&](unsigned char* payload, unsigned int len){
String input = String((const char*)payload).substring(0, len);
int brightness = constrain(input.toInt(), 0, 255);
setBrightness(brightness);
});
MQTT_subscribe("hanglamp/CMD/color", [&](unsigned char* payload, unsigned int len){
String input = String((const char*)payload).substring(0, len);
uint8_t r, g, b;
parseHexColor(input, r, g, b);
Serial.printf("input: %s, r: %d, g: %d, b: %d\n", input, r, g, b);
CRGB color(r, g, b);
setColor(color);
});
MQTT_subscribe("hanglamp/CMD/power", [&](unsigned char* payload, unsigned int len){
String input = String((const char*)payload).substring(0, len);
Serial.printf("Have power command: [%s]\n", input.c_str());
if(input == "true" || input == "1" || input == "on" || input == "ON"){
Serial.printf("Setting power to true\n");
turnOn();
}else{
Serial.printf("Setting power to false\n");
turnOff();
}
});
#endif
setColor(colorTable[this->colorIndex]);
turnOn();
}
void Hanglamp::setColor(CRGB color){
currentColor = color;
jumpTo(currentColor);
changed();
}
void Hanglamp::changed(){
#ifdef ENABLE_MQTT
char buff[128];
snprintf(buff, sizeof(buff),
"{\"color\":\"%02X%02X%02X\",\"brightness\":%d,\"power\":%s}",
currentColor.r,
currentColor.g,
currentColor.b,
brightness,
on ? "true" : "false"
);
MQTT_publish("hanglamp/status", buff);
#endif
}
void Hanglamp::nextColor(){
this->colorIndex++;
if(colorIndex >= (sizeof(colorTable) / sizeof(CRGB))){
colorIndex = 0;
}
Serial.printf("colorIndex: %d\n", colorIndex);
jumpTo(colorTable[colorIndex]);
}
#endif
Serial.printf("colorIndex: %d\n", this->colorIndex);
void setup() {
Serial.begin(115200);
delay(500);
#ifdef ENABLE_FS
if(!LittleFS.begin()){
Serial.println("LittleFS Mount Failed");
return;
}
#endif
// runner.init();
Serial.println("Initialized scheduler");
Serial.println("Scheduled tasks");
#ifdef ENABLE_PINFINDER
PinFinder_setup();
#endif
#ifdef INCLUDE_LED
Led_setup();
jumpTo(CRGB(0xFF00FF));
#endif
#ifdef ENABLE_WIFI
Wifi_setup();
#endif
#ifdef INCLUDE_LED
jumpTo(CRGB(0x00FFFF));
jumpTo(CRGB(0x000000));
#endif
#ifdef ENABLE_MQTT
MQTT_setup();
#endif
#ifdef ENABLE_OTA
OTA_setup();
#endif
#ifdef INCLUDE_LED
jumpTo(CRGB(0x00FFFF));
#endif
// ESP.wdtEnable(10000);
setColor(colorTable[this->colorIndex]);
}
void loop() {
#ifdef ENABLE_MQTT
MQTT_loop();
#endif
#ifdef ENABLE_OTA
OTA_loop();
#endif
#ifdef ENABLE_PINFINDER
PinFinder_loop();
#endif
#ifdef INCLUDE_LED
colors();
#endif
delay(1000);
return;
sleep(2000);
// Led_loop();
String command;
while(Serial.available()) {
command = Serial.readString();// read the incoming data as string
Serial.print("Have command: ");
Serial.println(command);
int index = command.indexOf(":");
if(index >= 0){
String name = command.substring(0, index);
Serial.print("Have command name: ");
Serial.println(name);
#ifdef INCLUDE_LED
if(name.equals("c")){
//c:0xff4000
//c:0xff0000
//c:0x00ff00
//c:0x0000ff
String color = command.substring(index+1);
if(color.startsWith("0x")){
color = color.substring(2);
void Hanglamp::setBrightness(int brightness){
uint8_t newBrightness = constrain(brightness, 0, 255);
if(!isOn()){
turnOn();
}
this->brightness = newBrightness;
Serial.printf("new brightness: %d\n", newBrightness);
FastLED.setBrightness(newBrightness);
FastLED.show();
changed();
}
int value = strtol(color.c_str(), NULL, 16);
CRGB target;
target.r = (value >> 16) & 0xFF;
target.g = (value >> 8) & 0xFF;
target.b = (value >> 0) & 0xFF;
jumpTo(target);
}
#endif
void Hanglamp::adjustBrightness(int add){
this->setBrightness(this->brightness + add);
}
void Hanglamp::controlsCallback(ControlEvent event){
Serial.printf("ControlEventType: %d\n", event);
switch(event.type){
case Clockwise:
adjustBrightness(4);
break;
case Counterclockwise:
adjustBrightness(-4);
break;
case Key:
Serial.printf("key press %d\n", event.data);
if(!isOn()){
turnOn();
}else{
auto msDuration = event.data/1000;
Serial.printf("msDuration %d\n", msDuration);
if(msDuration > 800){
turnOff();
}else{
nextColor();
}
}
break;
}
}
void Hanglamp::status(CRGB color){
Led_status(color);
}
void Hanglamp::setOn(bool on){
Serial.printf("Hanglamp::setOn(%d -> %d)\n", this->on, on);
this->on = on;
if(currentColor == CRGB::Black){
nextColor();
}
changed();
}
bool Hanglamp::isOn(){
return this->on;
}
void Hanglamp::turnOn(){
if(!this->on){
this->colorIndex = 1;
setColor(colorTable[1]);
FastLED.setBrightness(this->brightness);
FastLED.show();
this->setOn(true);
}
}
void Hanglamp::turnOff(){
if(this->on){
FastLED.setBrightness(0);
FastLED.show();
this->setOn(false);
}
}
+38
View File
@@ -0,0 +1,38 @@
#pragma once
#include "config.h"
#include <FastLED.h>
#include "Led.h"
#include "Controls.h"
#include "MQTT.h"
class Hanglamp {
public:
Hanglamp();
void setup();
void setBrightness(int brightness);
void adjustBrightness(int add);
void nextColor();
void controlsCallback(ControlEvent event);
void status(CRGB color);
void setColor(CRGB color);
bool isOn();
void turnOn();
void turnOff();
// void receiveBrightnessFromMQTT(uint8_t * payload, unsigned int len);
private:
void changed();
char colorIndex = 0;
CRGB currentColor;
int brightness = 128;
bool on = false;
void setOn(bool on);
};
+25 -8
View File
@@ -5,16 +5,23 @@ CRGB led;
CRGB source;
CRGB target;
#ifdef LEVEL_SHIFT_WS2812B
#define SKIP_PIXELS 1
#else
#define SKIP_PIXELS 0
#endif
CRGB strip1[STRIP_LENGTH];
CRGB strip2[STRIP_LENGTH];
#define NUM_LEDS STRIP_LENGTH + SKIP_PIXELS
// Add one black pixel to the front
CRGB strip1[NUM_LEDS];
CRGB strip2[NUM_LEDS];
int fadeStart = 0;
#ifdef LED_NEOPIXEL_BUS
NeoPixelBus<NeoGrbFeature, NeoWs2812xMethod> strip(STRIP_LENGTH, PIN_STRIP1);
#endif
void fadeTo(const CRGB & dest){
@@ -40,10 +47,10 @@ void fadeTo(const CRGB & dest){
void displayLed(){
#ifdef LED_FASTLED
for(uint8_t index = 0; index < STRIP_LENGTH; index++){
for(uint8_t index = SKIP_PIXELS; index < NUM_LEDS; index++){
// Serial.printf("Led 1:%02d 0x%02x%02x%02x\n", index, strip1[index].r, strip1[index].g, strip1[index].b);
}
for(uint8_t index = 0; index < STRIP_LENGTH; index++){
for(uint8_t index = SKIP_PIXELS; index < NUM_LEDS; index++){
// Serial.printf("Led 2:%02d 0x%02x%02x%02x\n", index, strip2[index].r, strip2[index].g, strip2[index].b);
}
auto before = micros();
@@ -73,7 +80,7 @@ void jumpTo(const CRGB & dest){
// Serial.printf("FastLED.showColor took %d micros\n", after - before);
// return;
for(uint8_t index = 0; index < STRIP_LENGTH; index++){
for(uint8_t index = SKIP_PIXELS; index < NUM_LEDS; index++){
strip1[index] = CRGB(dest);
strip2[index] = CRGB(dest);
}
@@ -116,8 +123,12 @@ void Led_setup(){
// analogWriteRange(255);
#ifdef LED_FASTLED
FastLED.addLeds<WS2812B, PIN_STRIP1>(strip2, STRIP_LENGTH);
FastLED.addLeds<WS2812B, PIN_STRIP2>(strip2, STRIP_LENGTH);
FastLED.addLeds<WS2812B, PIN_STRIP1, GRB>(strip2, NUM_LEDS).setRgbw(RgbwDefault());
FastLED.addLeds<WS2812B, PIN_STRIP2, GRB>(strip2, NUM_LEDS).setRgbw(RgbwDefault());
strip1[0] = CRGB::Black;
strip2[0] = CRGB::Black;
FastLED.show();
#endif
#ifdef LED_NEOPIXEL_BUS
@@ -148,3 +159,9 @@ void Led_loop(){
FastLED.show();
delay(500);
}
void Led_status(CRGB color){
strip1[0] = color;
strip2[0] = color;
FastLED.show();
}
+8 -2
View File
@@ -1,7 +1,10 @@
#pragma once
#include "stdint.h"
#include <cstdio>
#include "config.h"
#include <Arduino.h>
// #define LED_NEOPIXEL_BUS
@@ -20,10 +23,11 @@
#include <NeoPixelBus.h>
#endif
#define PIN_STRIP1 3
#define PIN_STRIP2 4
#define PIN_STRIP1 5
#define PIN_STRIP2 6
#define STRIP_LENGTH 46
#define LEVEL_SHIFT_WS2812B
#define FADE_PERIOD 3.0f
@@ -35,3 +39,5 @@ void jumpTo(const CRGB & dest);
void fadeTo(const CRGB & dest);
void fadeTask();
void Led_status(CRGB color);
+38 -28
View File
@@ -1,28 +1,35 @@
#ifdef ENABLE_MQTT
#include "MQTT.h"
#include <PubSubClient.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
WiFiClient espClient;
PubSubClient client(espClient);
std::vector<SubscribedChannel> * channels = new std::vector<SubscribedChannel>();
char mqtt_server[40] = "manus";
char mqtt_server[40] = "10.206.0.175";
char mqtt_port[6] = "1883";
uint32_t chipId = 0;
void connect() {
Serial.print("Attempting MQTT connection...");
if (WiFi.status() != WL_CONNECTED){
Serial.println("Wifi not connected");
return;
}
Serial.println("Attempting MQTT connection...");
// Create a random client ID
String clientId = "Konijntje-";
clientId += String(ESP.getChipId());
String clientId = "Hanglamp-";
clientId += String(chipId, 16);
Serial.printf("MQTT: Connecting as %s\n", clientId.c_str());
// Attempt to connect
if (client.connect(clientId.c_str())) {
Serial.println("connected");
@@ -39,20 +46,18 @@ void connect() {
}
void MQTT_publish(const char * topic, String str){
char * buff = new char[str.length() + 1];
str.toCharArray(buff, str.length() + 1);
MQTT_publish(topic, buff);
delete buff;
// char * buff = new char[str.length() + 1];
// str.toCharArray(buff, str.length() + 1);
MQTT_publish(topic, str.c_str());
// delete buff;
}
void MQTT_publish(const char * topic, const char * msg){
Serial.printf("MQTT_publish(%s, %s)\n", topic, msg);
client.publish(topic, msg);
}
void (*pCallback)(uint8_t *, unsigned int) = NULL;
void MQTT_subscribe(char * topic, void (*callback)(uint8_t *, unsigned int)){
void MQTT_subscribe(char * topic, mqtt_callback callback){
Serial.println("MQTT_subscribe");
Serial.printf("Topic: [%s]\n", topic);
@@ -81,21 +86,22 @@ void MQTT_callback(char* topic, uint8_t * payload, unsigned int length){
void MQTT_setup(){
Serial.println("MQTT_init");
for (int i = 0; i < 17; i = i + 8) {
chipId |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i;
}
Serial.printf("MQTT_init: %06x\n", chipId);
client.setServer(mqtt_server, String(mqtt_port).toInt());
client.setCallback(MQTT_callback);
// Serial.println("MQTT_init after callback");
// char buff[256];
// sprintf(buff, "%08x", _pCallback);
// Serial.println(buff);
connect();
TaskHandle_t taskMqtt = NULL;
xTaskCreate(MQTT_loop, "MQTT_loop", 10000, NULL, tskIDLE_PRIORITY, &taskMqtt);
}
void MQTT_loop(){
void MQTT_loop(void* params){
while(true){
#if DEBUG_GENERAL
Serial.println("MQTT_loop()");
#endif
@@ -106,14 +112,18 @@ void MQTT_loop(){
connect();
if(client.connected()){
Serial.println("MQTT: succes!");
Serial.println("MQTT: success!");
for (auto channel = channels->begin(); channel != channels->end(); ++channel){
client.subscribe(channel->topic->c_str());
}
break;
}else{
Serial.println("MQTT: connection failed, try again in 5 seconds");
// Wait 5 seconds before retrying
delay(5000);
vTaskDelay(5000/portTICK_PERIOD_MS);
}
}
client.loop();
vTaskDelay(100/portTICK_PERIOD_MS);
}
}
#endif
+14 -3
View File
@@ -1,21 +1,32 @@
#pragma once
#include "settings.h"
#include "config.h"
#include "Arduino.h"
#include <WiFi.h>
#include <vector>
using namespace std;
extern char mqtt_server[40];
extern char mqtt_port[6];
typedef std::function<void(unsigned char *, unsigned int)> mqtt_callback;
struct SubscribedChannel {
String * topic;
void (*callback)(uint8_t *, unsigned int);
mqtt_callback callback;
};
void MQTT_subscribe(char * topic, mqtt_callback callback);
void MQTT_publish(const char * topic, String str);
void MQTT_publish(const char * topic, const char * msg);
void MQTT_loop();
void MQTT_loop(void* params);
void MQTT_setup();
+44
View File
@@ -0,0 +1,44 @@
#include "OTA.h"
#include <ArduinoOTA.h>
void OTA_setup(){
ArduinoOTA
.onStart([]() {
String type;
if (ArduinoOTA.getCommand() == U_FLASH) {
type = "sketch";
} else { // U_SPIFFS
type = "filesystem";
}
// NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end()
Serial.println("Start updating " + type);
})
.onEnd([]() {
Serial.println("\nEnd");
})
.onProgress([](unsigned int progress, unsigned int total) {
Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
})
.onError([](ota_error_t error) {
Serial.printf("Error[%u]: ", error);
if (error == OTA_AUTH_ERROR) {
Serial.println("Auth Failed");
} else if (error == OTA_BEGIN_ERROR) {
Serial.println("Begin Failed");
} else if (error == OTA_CONNECT_ERROR) {
Serial.println("Connect Failed");
} else if (error == OTA_RECEIVE_ERROR) {
Serial.println("Receive Failed");
} else if (error == OTA_END_ERROR) {
Serial.println("End Failed");
}
});
ArduinoOTA.begin();
}
void OTA_loop(){
ArduinoOTA.handle();
}
+2
View File
@@ -0,0 +1,2 @@
void OTA_loop();
void OTA_setup();
+3
View File
@@ -1,2 +1,5 @@
#include "config.h"
void PinFinder_setup();
void PinFinder_loop();
+20 -11
View File
@@ -1,10 +1,6 @@
#ifdef ENABLE_WIFI
#include <ESP8266WiFi.h>
#include <ESPAsync_WiFiManager.h>
#include <Arduino.h>
#include <WiFi.h>
#include "WifiSettings.h"
@@ -24,15 +20,21 @@ void Wifi_setup_softap(){
}
void Wifi_setup(){
void Wifi_loop(void* params){
Serial.println("Wifi_setup()");
WiFi.mode(WIFI_STA);
//TODO:
WiFi.begin(WIFI_ESSID, WIFI_PASSWORD);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
while (true)
{
while (WiFi.status() != WL_CONNECTED)
{
Serial.println("Wifi waiting...");
vTaskDelay(5000 / portTICK_PERIOD_MS);
if(WiFi.status() != WL_CONNECTED){
WiFi.reconnect();
}
}
Serial.println("");
@@ -40,6 +42,13 @@ void Wifi_setup(){
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
vTaskDelay(60*1000 / portTICK_PERIOD_MS);
}
}
#endif
void Wifi_setup(){
TaskHandle_t taskWifi = NULL;
xTaskCreate(Wifi_loop, "Wifi_loop", 10000, NULL, tskIDLE_PRIORITY, &taskWifi);
}
+1 -1
View File
@@ -1,3 +1,3 @@
#include "config.h"
void Wifi_setup();
+12
View File
@@ -0,0 +1,12 @@
#pragma once
#define INCLUDE_LED
#define ENABLE_MQTT
#define ENABLE_OTA
#define ENABLE_WIFI
// #define ENABLE_FS
// #define ENABLE_PINFINDER
#define ENABLE_COLORS
// #define ENABLE_PIN_SENSING
#define ENABLE_CONTROLS
+188
View File
@@ -0,0 +1,188 @@
#include "config.h"
#ifdef INCLUDE_LED
#include "Led.h"
#endif
#include <Arduino.h>
#define _TASK_SLEEP_ON_IDLE_RUN // Enable 1 ms SLEEP_IDLE powerdowns between runs if no callback methods were invoked during the pass
#define _TASK_STATUS_REQUEST // Compile with support for StatusRequest functionality - triggering tasks on status change events in addition to time only
#ifdef ENABLE_WIFI
#include "Wifi.h"
#endif
#ifdef ENABLE_OTA
#include "OTA.h"
#endif
#ifdef ENABLE_MQTT
#include "MQTT.h"
#endif
#ifdef ENABLE_FS
#include "FS.h"
#include <LittleFS.h>
#endif
#ifdef ENABLE_PINFINDER
#include "PinFinder.h"
#endif
#ifdef ENABLE_CONTROLS
#include "Controls.h"
#endif
#include "Hanglamp.hpp"
Hanglamp hanglamp;
#ifdef ENABLE_CONTROLS
void controlsCallback(ControlEvent event){
hanglamp.controlsCallback(event);
}
#endif
#ifdef ENABLE_LED
#endif
void setup() {
Serial.begin(115200);
Serial.println("Waiting...");
delay(1500);
Serial.println("That's long enough.");
#ifdef ENABLE_PIN_SENSING
for(int i=0; i<sizeof(sensePins)/sizeof(gpio_num_t); i++){
auto pin = sensePins[i];
Serial.printf("Setting pin %d to input\n", pin);
// gpio_reset_pin(pin);
pinMode(pin, INPUT);
}
#endif
#ifdef ENABLE_FS
if(!LittleFS.begin()){
Serial.println("LittleFS Mount Failed");
return;
}
#endif
#ifdef ENABLE_PINFINDER
PinFinder_setup();
#endif
#ifdef ENABLE_CONTROLS
Controls_setup();
Controls_handler(controlsCallback);
#endif
#ifdef INCLUDE_LED
Led_setup();
FastLED.setBrightness(128);
hanglamp.status(CRGB(0xFF00FF));
#endif
hanglamp.setup();
#ifdef ENABLE_WIFI
Wifi_setup();
#endif
#ifdef INCLUDE_LED
hanglamp.status(CRGB(0x00FFFF));
hanglamp.status(CRGB(0x000000));
#endif
#ifdef ENABLE_MQTT
MQTT_setup();
#endif
#ifdef ENABLE_OTA
OTA_setup();
#endif
#ifdef INCLUDE_LED
hanglamp.status(CRGB(0x00FFFF));
#endif
delay(1000);
hanglamp.status(CRGB::Black);
}
void loop() {
#ifdef ENABLE_OTA
OTA_loop();
#endif
#ifdef ENABLE_PINFINDER
PinFinder_loop();
#endif
delay(1000);
String command;
while(Serial.available()) {
command = Serial.readString();// read the incoming data as string
Serial.print("Have command: ");
Serial.println(command);
int index = command.indexOf(":");
if(index >= 0){
String name = command.substring(0, index);
Serial.print("Have command name: ");
Serial.println(name);
#ifdef INCLUDE_LED
if(name.equals("c")){
//c:0xff4000
//c:0xff0000
//c:0x00ff00
//c:0x0000ff
String color = command.substring(index+1);
if(color.startsWith("0x")){
color = color.substring(2);
}
int value = strtol(color.c_str(), NULL, 16);
CRGB target;
target.r = (value >> 16) & 0xFF;
target.g = (value >> 8) & 0xFF;
target.b = (value >> 0) & 0xFF;
hanglamp.setColor(target);
}
#endif
}
}
}
-7
View File
@@ -1,7 +0,0 @@
#ifndef SETTINGS_H
#define SETTINGS_H
extern char mqtt_server[40];
extern char mqtt_port[6];
#endif