diff --git a/CS-qthing-testFW/device_main.cpp b/CS-qthing-testFW/device_main.cpp index 449ad516f2db74f6d9255da0f48da83a03cf1039..44a11577076118b12b439e7208edc2ed30a20fd6 100644 --- a/CS-qthing-testFW/device_main.cpp +++ b/CS-qthing-testFW/device_main.cpp @@ -14,10 +14,17 @@ using qthing::RGBW8; 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> { public: - FunctionTestAnimation() {} + FunctionTestAnimation(uint8_t size) : size((double)size) {} void step() override final { @@ -29,14 +36,15 @@ class FunctionTestAnimation : public Animation<HSV> { } 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); } private: - long time; float v; + long time; + double size; }; @@ -80,9 +88,15 @@ void device_main() { 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(); diff --git a/cad/CyanStripe/Material.scad b/cad/CyanStripe/Material.scad index ad995c14a40b57e0a1359839ff9576c15c3c508e..d4556d5ea1401f6e1f81a64565f2e0b694c6684a 100644 --- a/cad/CyanStripe/Material.scad +++ b/cad/CyanStripe/Material.scad @@ -12,3 +12,14 @@ module FR4(alpha=1.0) { module Solder(alpha=1.0) { 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 diff --git a/cad/CyanStripe/PCB.scad b/cad/CyanStripe/PCB.scad index 53675a46f28153e6fb45816b8e92c1ffb7a01296..93bb814790b3c5e24a05ddadb8ddccadc002fa79 100644 --- a/cad/CyanStripe/PCB.scad +++ b/cad/CyanStripe/PCB.scad @@ -41,7 +41,9 @@ co_y = -8.6; 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() { @@ -69,9 +71,42 @@ module pcb3D(pcb_t=pcb_t()) { translate([0, 0, -$E*2]) cylinder(d=M3()-$E, h=pcb_t()+4*$E); } - Solder() - translate([tpow_x(), tpow_y(), pcb_t() - $E]) - cube([tpow_sx(), tpow_sy(), tpow_sz()], center=true); +// Solder() +// translate([tpow_x(), tpow_y(), pcb_t() - $E]) +// 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); } }