diff --git a/src/modules/info_ports/big_gear.stl b/src/modules/info_ports/big_gear.stl deleted file mode 100644 index af5b919..0000000 Binary files a/src/modules/info_ports/big_gear.stl and /dev/null differ diff --git a/src/modules/info_ports/container.stl b/src/modules/info_ports/container.stl deleted file mode 100644 index 6dd49e7..0000000 Binary files a/src/modules/info_ports/container.stl and /dev/null differ diff --git a/src/modules/info_ports/container_bottom.stl b/src/modules/info_ports/container_bottom.stl deleted file mode 100644 index afb48d4..0000000 Binary files a/src/modules/info_ports/container_bottom.stl and /dev/null differ diff --git a/src/modules/info_ports/cylinder.stl b/src/modules/info_ports/cylinder.stl deleted file mode 100644 index 38002fa..0000000 Binary files a/src/modules/info_ports/cylinder.stl and /dev/null differ diff --git a/src/modules/info_ports/info_ports.ino b/src/modules/info_ports/info_ports.ino new file mode 100644 index 0000000..8469f54 --- /dev/null +++ b/src/modules/info_ports/info_ports.ino @@ -0,0 +1,30 @@ +/* Example sketch to control a 28BYJ-48 stepper motor with ULN2003 driver board and Arduino UNO. More info: https://www.makerguides.com */ +// Include the Arduino Stepper.h library: +#include +// Define number of steps per rotation: +const int stepsPerRevolution = 2048; +// Wiring: +// Pin 8 to IN1 on the ULN2003 driver +// Pin 9 to IN2 on the ULN2003 driver +// Pin 10 to IN3 on the ULN2003 driver +// Pin 11 to IN4 on the ULN2003 driver +// Create stepper object called 'myStepper', note the pin order: +Stepper myStepper = Stepper(stepsPerRevolution, 8, 10, 9, 11); +void setup() { + // Set the speed to 5 rpm: + myStepper.setSpeed(5); + + // Begin Serial communication at a baud rate of 9600: + Serial.begin(9600); +} +void loop() { + // Step one revolution in one direction: + Serial.println("clockwise"); + myStepper.step(stepsPerRevolution); + delay(500); + + // Step one revolution in the other direction: + Serial.println("counterclockwise"); + myStepper.step(-stepsPerRevolution); + delay(500); +} \ No newline at end of file diff --git a/src/modules/info_ports/info_ports.scad b/src/modules/info_ports/info_ports.scad index 3502b60..10b067f 100644 --- a/src/modules/info_ports/info_ports.scad +++ b/src/modules/info_ports/info_ports.scad @@ -10,6 +10,7 @@ ports = len(port_sizes); distance_between_ports=5; cutout_radius=100; // not a physical dimension +cut=cutout_radius; safe_angle=1; eps=0.0001; @@ -71,15 +72,24 @@ module rotating_cylinder() { } } -module small_gear_cylinder() { - spur_gear(modul=modul, tooth_number=small_gear, width=gear_height, bore=1, pressure_angle=20, helix_angle=0, optimized=false); - cylinder(r=5, h=gear_height+5, $fn=6); - mirror(v=[0, 0, 1]) cylinder(r=5-clearance/2, h=wall_thickness+distance_between_ports+2); -} - // http://sammy76.free.fr/conseils/electronique/arduino/SG90.php clearance=0.5; +// Print upside-down +module small_gear_cylinder() { + b_diam=5; + difference() { + union() { + cylinder(h=gear_height, r=7); + translate([0, 0, b_diam/2]) rotate([0, 90, 0]) cylinder(d=b_diam, h=25); + cylinder(d=10-clearance, h=gear_height+5, $fn=6); + mirror(v=[0, 0, 1]) cylinder(r=5-clearance/2, h=wall_thickness+distance_between_ports+2-5); + } + mirror(v=[0, 0, 1]) cube([3, 5, 12], center=true); + } + +} + ignore_height=4; ignore_diameter=11.8; extra_ignore_part=2.9; @@ -149,18 +159,6 @@ module container() { } } -module extragear() { - difference() { - spur_gear (modul=modul, tooth_number=big_gear, width=gear_height, bore=0, pressure_angle=20, helix_angle=0, optimized=false); - union() { - translate([-10, -4, gear_height-4]) cube([20, 8, 100]); - translate([-6.325, 0, -1]) cylinder(r=0.5, h=100); - translate([6.325, 0, -1]) cylinder(r=0.5, h=100); - } - } - -} - module prism(l, w, h){ polyhedron( points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]], @@ -227,6 +225,27 @@ module container_bottom() { } } +module ccube(size = [1,1,1], center = false) +{ + sz = (len(size) == 3)?size:[size,size,size]; + if (len(center) == 1) + cube(size, center); + else + translate([center[0]?-sz[0]/2:0,center[1]?-sz[1]/2:0,center[2]?-sz[2]/2:0]) + cube(size); +} + + +module keycap() { + difference() { + scale([12, 7, 15]) sphere(d=1); + union() { + ccube([cut, cut, cut], center=[true, true, false]); + } + } + translate([-5.8/2, 0, 0]) ccube([1, 2.5, 3], center=[1, 1, 0]); + translate([5.8/2, 0, 0]) ccube([1, 2.5, 3], center=[1, 1, 0]); +} /* color([1, 1, 0]) */ translation_outer = -outer_radius - wall_thickness - clearance; @@ -237,8 +256,9 @@ translation_outer = -outer_radius - wall_thickness - clearance; /* translate([125, 0, 0]) container(); */ -translate([0, 130, 0]) extragear(); -/* translate([0, 170, 0]) small_gear_cylinder(); */ +small_gear_cylinder(); /* translate([125 + translation_outer, 125, -wall_thickness]) container_bottom(); */ + +// keycap(); \ No newline at end of file diff --git a/src/modules/info_ports/small_gear_cylinder.stl b/src/modules/info_ports/small_gear_cylinder.stl deleted file mode 100644 index b26887b..0000000 Binary files a/src/modules/info_ports/small_gear_cylinder.stl and /dev/null differ