Skip to content

Commit 1e3a9b6

Browse files
committed
eastereggs
1 parent 7c70fac commit 1e3a9b6

File tree

2 files changed

+35
-18
lines changed

2 files changed

+35
-18
lines changed

certamen.ino

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
See COPYING
33
*/
44

5+
//#define EASTER_EGGS
56
#undef TEST_MODE
67
#define RANDOM_PRESS_FREQUENCY 0
78
#define CLEAR_FREQUENCY 0
@@ -184,7 +185,7 @@ void setupScreen() {
184185
// screen.print("Pruss's Certamen Machine");
185186
// screen.setCursor(1,1+10);
186187
// screen.print("GPL3 licensed firmware");
187-
draw_nicefont(screen, "Pruss's Certamen Machine", 1, 1, textColor);
188+
draw_nicefont(screen, "Pruss Certamen Machine", 1, 1, textColor);
188189
draw_nicefont(screen, "GPL3 licensed firmware", 1, 21, textColor);
189190
delay(2500);
190191
screen.fillScreen(backgroundColor);
@@ -243,6 +244,7 @@ void updateScreen() {
243244
}
244245

245246
#elif defined(USE_LIQUID_CRYSTAL)
247+
246248
void setupScreen() {
247249
pinMode(BACKLIGHT_PIN, HIGH);
248250
digitalWrite(BACKLIGHT_PIN, HIGH);
@@ -251,10 +253,15 @@ void setupScreen() {
251253
#endif
252254
lcd.begin(SCREEN_COLUMNS, SCREEN_LINES);
253255
lcd.setCursor(0, 0);
254-
lcd.print("Pruss's Certamen");
256+
lcd.print("Pruss Certamen");
255257
lcd.setCursor(0, 1);
256258
lcd.print("GPLv3 license");
257-
delay(2500);
259+
delay(2000);
260+
#ifdef EASTER_EGGS
261+
if (LOW == digitalRead(clearPin)) {
262+
easterEggs();
263+
}
264+
#endif
258265
lcd.clear();
259266
}
260267

mainbox.scad

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// TODO: speaker holders should end at cutLine
2-
// increase underPCBs by 2.5
31

42
use <roundedsquare.scad>;
53
use <certamenbutton.scad>;
@@ -10,7 +8,7 @@ TOP = 1;
108
BOTTOM = 2;
119
WASHERS = 3;
1210

13-
mode = DEMO;
11+
mode = WASHERS;
1412

1513
screwLength = 9.61;
1614

@@ -37,13 +35,13 @@ megaPCBThickness = 1.66;
3735
megaFrontCutouts = [ [7, megaPCBThickness, 12.23, 10.82],
3836
[ 37.78, megaPCBThickness, 9.04, 11 ] ];
3937
cbWidth = 54.9;
40-
cbLength = 99.06; // between edges of RJ-45 breakout board
38+
cbLength = 93; // 99.06 between edges of RJ-45 breakout board
4139
cbPCBThickness = 1.7;
4240
cbFrontCutouts = [
4341
[5.88,5.45,15.15,11.56] /* B */,
4442
[cbWidth-5.58-15.15,5.45,15.15,11.56] /* A */];
4543
cbBackCutouts = [[cbWidth-5.58-15.15,5.45,15.15,11.56] /* C */];
46-
cbHoles = [[4.04,7.5],[cbWidth-4.04,7.5],[4.04,84.6+7.5],[cbWidth-4.04,84.6+7.5]];
44+
cbHoles = [[4.04,4.19],[cbWidth-4.04,4.19],[4.04,84.6+4.19],[cbWidth-4.04,84.6+4.19]];
4745

4846
pcbThickness = max(cbPCBThickness,megaPCBThickness);
4947

@@ -107,7 +105,7 @@ labelX = (screenX - screenHeight/2)*0.5-labelSize/2;
107105
labelY = insideLength/2;
108106

109107
cbX = fitTolerance;
110-
cbY = fitTolerance;
108+
cbY = insideLength/2-cbLength/2;
111109
megaX = 3*fitTolerance+cbWidth+boardDivider;
112110
megaY = fitTolerance;
113111
topZ = boxHeight-topThickness-bottomThickness;
@@ -155,14 +153,14 @@ module contents(visualize=true) {
155153
cutoutLength = visualize?10:100;
156154
extraCutout = visualize?0:cutoutTolerance;
157155
color("blue") {
158-
translate( [megaX,fitTolerance,underPCBs] ) cube([megaWidth, megaLength, megaPCBThickness]);
159-
translate([megaX,fitTolerance-cutoutLength,underPCBs]) cutouts(megaFrontCutouts, cutoutLength,extraCutout);
156+
translate( [megaX,megaY,underPCBs] ) cube([megaWidth, megaLength, megaPCBThickness]);
157+
translate([megaX,megaY-cutoutLength,underPCBs]) cutouts(megaFrontCutouts, cutoutLength,extraCutout);
160158
}
161159
color("red") {
162-
translate( [cbX,fitTolerance,underPCBs])
160+
translate( [cbX,cbY,underPCBs])
163161
cube([cbWidth, cbLength, cbPCBThickness]);
164-
translate([cbX,fitTolerance-cutoutLength,underPCBs]) cutouts(cbFrontCutouts, cutoutLength,extraCutout);
165-
translate([cbX,fitTolerance+cbLength,underPCBs]) cutouts(cbBackCutouts, cutoutLength,extraCutout);
162+
translate([cbX,cbY-cutoutLength,underPCBs]) cutouts(cbFrontCutouts, cutoutLength,extraCutout);
163+
translate([cbX,cbY+cbLength,underPCBs]) cutouts(cbBackCutouts, cutoutLength,extraCutout);
166164
}
167165
color([0,.4,0]) {
168166
translate([screenX-screenHeight/2-extraCutout,screenY-screenWidth/2-extraCutout,topZ-5]) cube([screenHeight+2*extraCutout,screenWidth+2*extraCutout,cutoutLength+5]);
@@ -185,7 +183,8 @@ module boardMounts() {
185183
translate([cbX-fitTolerance-pcbHolderThickness,0,0]) cube([pcbHolderThickness,insideLength,pcbHolderHeight]);
186184
translate([cbX+cbWidth+fitTolerance,0,0]) cube([pcbHolderThickness,insideLength,pcbHolderHeight]);
187185
translate([megaX+megaWidth+fitTolerance,0,0]) cube([pcbHolderThickness,insideLength,pcbHolderHeight]);
188-
translate([0,insideLength-(megaLength-cbLength),0]) cube([2*fitTolerance+cbWidth, megaLength-cbLength, pcbHolderHeight]);
186+
translate([0,insideLength-(megaLength-cbLength)/2,0]) cube([2*fitTolerance+cbWidth, pcbHolderThickness, underPCBs+pcbThickness+1]);
187+
translate([0,(megaLength-cbLength)/2-pcbHolderThickness,0]) cube([2*fitTolerance+cbWidth, pcbHolderThickness, underPCBs+pcbThickness+1]);
189188
}
190189
box();
191190
}
@@ -258,13 +257,13 @@ module shell() {
258257
}
259258

260259
module speakerMount() {
261-
height = nudge+topZ-speakerZ+10;
260+
height = topZ-cutLine;
262261
module strip() {
263262
cube([speakerMountXStickout+speakerMountThickness,speakerMountThickness,height]);
264263
translate([speakerMountXStickout,0,0])
265264
cube([speakerMountThickness,speakerMountYStickout+speakerMountThickness,height]);
266265
}
267-
translate([speakerX+nudge,speakerY,0])
266+
translate([speakerX+nudge,speakerY,nudge])
268267
rotate([0,0,180]) {
269268
translate([0,0,topZ-height]) {
270269
translate([0,-speakerDiameter1/2-speakerMountThickness,0]) strip();
@@ -399,8 +398,19 @@ module screenWasher() {
399398
}
400399
}
401400

401+
module pcbWasher() {
402+
pillarSize=screwHeadSize+2*fitTolerance;
403+
length = 2;
404+
render(convexity=2)
405+
difference() {
406+
cylinder(d=pillarSize, h=length, $fn=16);
407+
translate([0,0,-nudge]) cylinder(d=screwHoleSize1+1, h=length+2*nudge, $fn=16);
408+
}
409+
}
410+
402411
module washers() {
403-
for(i=[0:3]) translate([15*i,0,0]) screenWasher();
412+
//for(i=[0:3]) translate([15*i,0,0]) screenWasher();
413+
for(i=[0:3]) translate([15*i,15,0]) pcbWasher();
404414
}
405415

406416
module demo() {

0 commit comments

Comments
 (0)