1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-01-16 21:18:15 +01:00

Add PT_camera to examples and gallery

This commit is contained in:
Hermann-SW 2024-06-30 14:54:02 +02:00
parent ad74378e7e
commit 07866f7284
3 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,54 @@
include <../../vitamins/geared_steppers.scad>
include <../../core.scad>
include <../../vitamins/cameras.scad>
use <../../vitamins/pcb.scad>
module ptc(ang2) {
rotate([180,0,0])
union(){
geared_stepper(28BYJ_48,ang2);
rotate([90,0,180-ang2])
translate([9.8,-16.5,1.7])
rotate([0,0,90])
camera(cameras[0]);
}
}
module pt(ang,ang2) {
rotate([180,0,0]) geared_stepper(28BYJ_48,ang);
rotate([0,0,ang]) rotate([270,0,0]) translate([0,-29.0,-1.5]) ptc(ang2);
}
deg=90;
c=90;
if($t<0.125){
a=180+$t/0.125*deg;
pt(a,c);
}else if ($t<0.25){
a=180+deg-($t-0.125)/0.125*deg;
pt(a,c);
}else if ($t<0.375){
b=c+($t-0.25)/0.125*deg;
pt(180,b);
}else if ($t<0.5){
b=c+deg-($t-0.375)/0.125*deg;
pt(180,b);
}
else if($t<0.625){
a=180+($t-0.5)/0.125*deg;
b=c+deg-90+($t-0.5)/0.125*deg;
pt(a,b);
}else if ($t<0.75){
a=180+deg-($t-0.625)/0.125*deg;
b=c+deg-($t-0.625)/0.125*deg;
pt(a,b);
}else if ($t<0.875){
a=180-($t-0.75)/0.125*deg;
b=c-($t-0.75)/0.125*deg;
pt(a,b);
}else{
a=90+($t-0.875)/0.125*deg;
b=c+deg-180+($t-0.875)/0.125*deg;
pt(a,b);
}

BIN
gallery/PT_camera.anim.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@ -106,6 +106,10 @@ A base and shroud to make PSU safe to sit on a desk
![](PSU_tube.png) ![](PSU_tube.png)
## PT_camera
Two 28BYJ_48 geared stepper motors and a Raspberry v1 camera, combined with [4 drops of superglue](https://forums.raspberrypi.com/viewtopic.php?p=1810000#p1810000). Script [PT_camera.scad](../examples/PT_camera/PT_camera.scad) nicely demonstrates new 2nd optional arg (motor shaft angle) of ```geared_stepper()```.
![](PT_camera.anim.gif)
## PotBox ## PotBox
Potentiometer box with course and fine controls and three 4mm binding posts Potentiometer box with course and fine controls and three 4mm binding posts