-
Notifications
You must be signed in to change notification settings - Fork 0
/
ADXL345-Ref.scad
71 lines (59 loc) · 1.58 KB
/
ADXL345-Ref.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
module ADXL345() {
// Reference model of the ADXL345 board that I have.
$fn = 10;
Length = 21;
Width = 16;
Depth = 1;
HoleDist = 16;
HoleOffset = 1;
HoleRad = 3.5/2;
module Hole() {
translate([HoleDist/2,Width/2-HoleOffset-HoleRad,0])
cylinder(Depth*2,HoleRad,HoleRad,center=true);
}
Pins = 8;
// PinDistance = Length/(Pins+1);
PinDistance = 2.5;
PinsOffset = 2;
PinHoleRad = 0.3;
module PinHoles() {
translate([-Length/2-PinDistance/4, - Width/2 + PinsOffset,0])
for(i = [1 : 1 : Pins]) {
translate([i*PinDistance,0,0])
cylinder(Depth*2, PinHoleRad, PinHoleRad, center=true);
}
}
// Headers
PinHeight = 11;
BlockWidth = 2;
BlockDepth = BlockWidth;
BlockLength = 2.5;
BlockOffset = 3;
module Pin() {
// Block
color("black")
translate([0,0,PinHeight/2 - BlockOffset - BlockDepth/2])
cube([BlockLength, BlockWidth, BlockDepth], center=true);
// Pin
color("grey")
cylinder(PinHeight, 0.2, 0.2, center=true);
}
translate([0,0,Depth/2]) {
// Board
difference() {
color("green")
cube([Length,Width,Depth], center = true);
Hole();
mirror([1,0,0])
Hole();
PinHoles();
}
// Pins
translate([-Length/2 - PinDistance/4, - Width/2 + PinsOffset,0])
for(i = [1 : 1 : Pins]) {
translate([i*PinDistance,0,0])
Pin();
}
}
}
// ADXL345();