Skip to content
Snippets Groups Projects
Commit 37af9892 authored by fxk8y's avatar fxk8y :spider:
Browse files

Merge branch 'master' of git.services.c3pb.de:fxk8y/CyanLight

parents 71ccc729 e4ed2012
No related branches found
No related tags found
No related merge requests found
...@@ -14,10 +14,17 @@ using qthing::RGBW8; ...@@ -14,10 +14,17 @@ using qthing::RGBW8;
using qthing::HSV; using qthing::HSV;
// TODO: Move somewhere else!
constexpr uint8_t channelW = 27;
constexpr uint8_t channelX = 23;
constexpr uint8_t channelY = 22;
constexpr uint8_t channelZ = 21;
class FunctionTestAnimation : public Animation<HSV> { class FunctionTestAnimation : public Animation<HSV> {
public: public:
FunctionTestAnimation() {} FunctionTestAnimation(uint8_t size) : size((double)size) {}
void step() override final { void step() override final {
...@@ -29,14 +36,15 @@ class FunctionTestAnimation : public Animation<HSV> { ...@@ -29,14 +36,15 @@ class FunctionTestAnimation : public Animation<HSV> {
} }
HSV render(uint16_t address) { HSV render(uint16_t address) {
float h = fmod(this->time/6400.l /* + address/8.l */, 1); float h = fmod(this->time/6400.l + address/size, 1);
return HSV(h, 1.0f, 1.0f); return HSV(h, 1.0f, 1.0f);
} }
private: private:
long time;
float v; float v;
long time;
double size;
}; };
...@@ -80,9 +88,15 @@ void device_main() { ...@@ -80,9 +88,15 @@ void device_main() {
qthing::Config cfg; qthing::Config cfg;
auto ledW = cfg.add<qthing::leds::WS2812B_V2>(GPIO_NUM_27, 8); auto ledW = cfg.add<qthing::leds::WS2812B_V2>((gpio_num_t)channelW, 8);
auto ledX = cfg.add<qthing::leds::WS2812B_V2>((gpio_num_t)channelX, 50);
auto ledY = cfg.add<qthing::leds::WS2812B_V2>((gpio_num_t)channelY, 50);
auto ledZ = cfg.add<qthing::leds::WS2812B_V2>((gpio_num_t)channelZ, 50);
cfg.add<Animator<RGBW8>>(ledW)->setNewAnimation<FunctionTestAnimation>(); cfg.add<Animator<RGBW8>>(ledW)->setNewAnimation<FunctionTestAnimation>(8);
cfg.add<Animator<RGBW8>>(ledX)->setNewAnimation<FunctionTestAnimation>(50);
cfg.add<Animator<RGBW8>>(ledY)->setNewAnimation<FunctionTestAnimation>(50);
cfg.add<Animator<RGBW8>>(ledZ)->setNewAnimation<FunctionTestAnimation>(50);
cfg.apply(); cfg.apply();
......
...@@ -12,3 +12,14 @@ module FR4(alpha=1.0) { ...@@ -12,3 +12,14 @@ module FR4(alpha=1.0) {
module Solder(alpha=1.0) { module Solder(alpha=1.0) {
color("grey", alpha=alpha) children(); color("grey", alpha=alpha) children();
} }
module GreyPlastic(alpha=1.0) {
color("grey", alpha=alpha) children();
}
module Copper(alpha=1.0) {
color("#912E17", alpha=alpha) children();
// color("maroon", alpha=alpha) children();
}
Copper() cube(20);
\ No newline at end of file
...@@ -41,7 +41,9 @@ co_y = -8.6; ...@@ -41,7 +41,9 @@ co_y = -8.6;
module pcbScrewHoles(tz=0) { module pcbScrewHoles(tz=0) {
for (tx=[-32.75, 5.75], ty=[-27.5, 27.5]) translate([tx, ty, tz]) children(); for (tx=[-32.75, 5.75], ty=[-27.5, 27.5])
translate([tx, ty, tz])
children();
} }
module pcbOutline() { module pcbOutline() {
...@@ -69,9 +71,42 @@ module pcb3D(pcb_t=pcb_t()) { ...@@ -69,9 +71,42 @@ module pcb3D(pcb_t=pcb_t()) {
translate([0, 0, -$E*2]) cylinder(d=M3()-$E, h=pcb_t()+4*$E); translate([0, 0, -$E*2]) cylinder(d=M3()-$E, h=pcb_t()+4*$E);
} }
Solder() // Solder()
translate([tpow_x(), tpow_y(), pcb_t() - $E]) // translate([tpow_x(), tpow_y(), pcb_t() - $E])
cube([tpow_sx(), tpow_sy(), tpow_sz()], center=true); // cube([tpow_sx(), tpow_sy(), tpow_sz()], center=true);
translate([tpow_x(), tpow_y(), pcb_t() - $E])
terminal2();
}
}
// MP = measure precisely!
t_h0 = 9.5; // TODO: MP!
t_h1 = 14.0; // TODO: MP!
t_l_sx = 5.5; // TODO: MP! // l = lever
t_oh = 1.5; // oh = overhang
t2_sx = 11.0 + t_oh;
t2_sy = 11.5;
t2_l_sy = 8.5; // TODO: MP!
module terminal2() {
GreyPlastic() difference() {
union() {
translate([-t_oh/2, 0, 0])
linear_extrude(t_h0)
roundRect(t2_sx, t2_sy, 0.69, center=true);
translate([-t_oh/2, 0, 0])
linear_extrude(t_h1)
roundRect(t_l_sx, t2_l_sy, 1.337, center=true);
}
_ty = t2_sy * 1/4;
for (ty=[-_ty, _ty])
translate([-t2_sx/2, ty, t_h0/2])
rotate([0, -90, 0])
cylinder(d=3, h=8, center=true);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment