Compare commits

..

No commits in common. "bcce75feac6267e48a20d88cccb71c0379b31cf0" and "e60c7bce058e0d8c71ed631b5c4bcefb1b440978" have entirely different histories.

10 changed files with 340329 additions and 71416 deletions

View File

@ -10,7 +10,6 @@
#define SECOND (1000 * MILLISECOND) #define SECOND (1000 * MILLISECOND)
VailAdapter::VailAdapter(unsigned int PiezoPin) { VailAdapter::VailAdapter(unsigned int PiezoPin) {
this->keyboardMode = true;
this->buzzer = new PolyBuzzer(PiezoPin); this->buzzer = new PolyBuzzer(PiezoPin);
this->txToneFrequency = 440; this->txToneFrequency = 440;
} }
@ -109,7 +108,6 @@ void VailAdapter::HandleMIDI(midiEventPacket_t event) {
this->keyer->Release(); this->keyer->Release();
} }
this->keyer = GetKeyerByNumber(event.byte2, this); this->keyer = GetKeyerByNumber(event.byte2, this);
this->keyer->SetDitDuration(this->ditDuration);
break; break;
case 0x80: // Note off case 0x80: // Note off
this->buzzer->NoTone(1); this->buzzer->NoTone(1);

390328
case/body.stl

File diff suppressed because it is too large Load Diff

21342
case/cap.stl

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Make circles lovely and round // Make circles lovely and round
$fa = 1; $fs = 0.1; $fa = 1; $fs = 0.1;
outer_dimensions = [24.2, 21, 25]; outer_dimensions = [24.2, 21, 27];
outer_radius = 3.7; outer_radius = 3.7;
wall_width = [1.3, 1.3, 1.3]; wall_width = [1.3, 1.3, 1.3];
inner_dimensions = outer_dimensions - (wall_width * 2); inner_dimensions = outer_dimensions - (wall_width * 2);
@ -14,20 +14,27 @@ channel = [16, 1, 1]; // Difensions of cap channel
channel_height = 2; // How far into the case the clips need to go channel_height = 2; // How far into the case the clips need to go
cap_thickness = 1.3; cap_thickness = 1.3;
module roundedcube(size=[1, 1, 1], center=false, r=0.5) { // More information: https://danielupshaw.com/openscad-rounded-corners/
size = (size[0]==undef) ? [size, size, size] : size; module roundedcube_simple(size=[1, 1, 1], center=false, r=0.5) {
cubeSize = [size[0] - 2*r, size[1] - 2*r, size[2]]; // If single value, convert to [x, y, z] vector
size = (size[0] == undef) ? [size, size, size] : size;
translate(center ? [0,0,0] : size/2) { translate = (center == false) ?
union() { [r, r, r] :
cube([size[0], cubeSize[1], size[2]], center=true); [
cube([cubeSize[0], size[1], size[2]], center=true); r - (size[0] / 2),
for (ymul = [-0.5, 0.5]) { r - (size[1] / 2),
for (xmul = [-0.5, 0.5]) { r - (size[2] / 2)
translate([cubeSize[0]*xmul, cubeSize[1]*ymul, 0]) cylinder(h=size[2], r=r, center=true); ];
}
} translate(v = translate)
} minkowski() {
cube(size = [
size[0] - (r * 2),
size[1] - (r * 2),
size[2] - (r * 2)
]);
sphere(r = r);
} }
} }
@ -47,12 +54,10 @@ module usb_c() {
module case() { module case() {
difference() { difference() {
translate((outer_dimensions * z_elevate) + ([0, 0, -1] * cap_thickness)) { translate((outer_dimensions * z_elevate) + ([0, 0, -1] * outer_radius)) difference() {
difference() { roundedcube_simple(outer_dimensions, center=true, r=outer_radius);
roundedcube(outer_dimensions, center=true, r=outer_radius); roundedcube_simple(inner_dimensions, center=true, r=inner_radius);
roundedcube(inner_dimensions, center=true, r=inner_radius); translate(-outer_dimensions/2) cube([100, 100, outer_radius]);
translate(-outer_dimensions/2) cube([100, 100, cap_thickness]);
}
} }
// USB C port // USB C port
@ -81,7 +86,7 @@ module body() {
translate([-6, 0, xiao_elevation]) rotate(45, [0, 0, 1]) cube(15, center=true); translate([-6, 0, xiao_elevation]) rotate(45, [0, 0, 1]) cube(15, center=true);
} }
} }
translate(outer_dimensions * center) roundedcube(outer_dimensions, r=outer_radius); translate(outer_dimensions * center) roundedcube_simple(outer_dimensions, r=outer_radius);
} }
@ -104,7 +109,7 @@ module body() {
// Channel in the back to make it easier to squeeze in the XIAO // Channel in the back to make it easier to squeeze in the XIAO
translate([-4.5, 0, xiao_elevation]) intersection() { translate([-4.5, 0, xiao_elevation]) intersection() {
cube([13, 100, pcb_thickness], center=true); cube([13, 100, pcb_thickness], center=true);
roundedcube(inner_dimensions, center=true, r=cap_thickness); roundedcube_simple(inner_dimensions, center=true, r=inner_radius);
} }
// Channels for bottom insertion part thingy // Channels for bottom insertion part thingy
@ -138,11 +143,11 @@ module cap() {
inner = inner_dimensions * 0.97; // leave 5% slop inner = inner_dimensions * 0.97; // leave 5% slop
union() { union() {
intersection() { intersection() {
roundedcube(outer_dimensions, center=true, r=outer_radius); roundedcube_simple(outer_dimensions, center=true, r=outer_radius);
translate([0, 0, cap_thickness/2]) cube([100, 100, cap_thickness], center=true); translate([0, 0, cap_thickness/2]) cube([100, 100, cap_thickness], center=true);
} }
intersection() { intersection() {
roundedcube(inner, center=true, r=inner_radius); roundedcube_simple(inner, center=true, r=inner_radius);
translate(center * inner) cube([100, 100, cap_thickness+2.2]); translate(center * inner) cube([100, 100, cap_thickness+2.2]);
} }
difference() { difference() {
@ -170,9 +175,7 @@ if (TARGET == "body") {
body(); body();
} else if (TARGET == "cap") { } else if (TARGET == "cap") {
cap(); cap();
} else if (true == true) { } else {
color([0, 0.5, 0.5]) body(); color([0, 0.5, 0.5]) body();
color([0.5, 0, 0.5]) translate([0, 0, -cap_thickness]) cap(); color([0.5, 0, 0.5]) translate([0, 0, -cap_thickness]) cap();
} else {
roundedcube(10);
} }

View File

@ -66,7 +66,7 @@ public:
this->ditDuration = 100; this->ditDuration = 100;
} }
void SetDitDuration(unsigned int duration) { void SetDitDuration(int duration) {
this->ditDuration = duration; this->ditDuration = duration;
} }

View File

@ -18,7 +18,7 @@ class Keyer {
public: public:
virtual void SetOutput(Transmitter *output); virtual void SetOutput(Transmitter *output);
virtual void Reset(); virtual void Reset();
virtual void SetDitDuration(unsigned int d); virtual void SetDitDuration(int d);
virtual void Release(); virtual void Release();
virtual bool TxClosed(); virtual bool TxClosed();
virtual bool TxClosed(int relay); virtual bool TxClosed(int relay);

View File

@ -16,10 +16,10 @@ void PolyBuzzer::update() {
if (playing != tones[i]) { if (playing != tones[i]) {
playing = tones[i]; playing = tones[i];
tone(this->pin, tones[i]); tone(this->pin, tones[i]);
}
return; return;
} }
} }
}
this->playing = 0; this->playing = 0;
noTone(this->pin); noTone(this->pin);
} }

View File

@ -1,11 +1,11 @@
#include "touchbounce.h" #include "touchbounce.h"
void TouchBounce::attach(int pin) { void TouchBounce::attach(int pin) {
this->qt = Adafruit_FreeTouch(pin, OVERSAMPLE_2, RESISTOR_0, FREQ_MODE_SPREAD); this->qt = Adafruit_FreeTouch(pin, OVERSAMPLE_2, RESISTOR_50K, FREQ_MODE_NONE);
this->qt.begin(); this->qt.begin();
} }
bool TouchBounce::readCurrentState() { bool TouchBounce::readCurrentState() {
int val = this->qt.measure(); int val = this->qt.measure();
return val > QT_THRESHOLD; return val > QT_THRESHOLD/2;
} }

View File

@ -3,7 +3,7 @@
#include <Adafruit_FreeTouch.h> #include <Adafruit_FreeTouch.h>
#include "bounce2.h" #include "bounce2.h"
#define QT_THRESHOLD 450 #define QT_THRESHOLD 850
class TouchBounce: public Bounce { class TouchBounce: public Bounce {
public: public:

View File

@ -22,7 +22,7 @@
#define DIT_KEYBOARD_KEY KEY_LEFT_CTRL #define DIT_KEYBOARD_KEY KEY_LEFT_CTRL
#define DAH_KEYBOARD_KEY KEY_RIGHT_CTRL #define DAH_KEYBOARD_KEY KEY_RIGHT_CTRL
#define TONE 3000 #define TONE 550
#define MILLISECOND 1 #define MILLISECOND 1
#define SECOND (1 * MILLISECOND) #define SECOND (1 * MILLISECOND)