Case work, bugfixes

This commit is contained in:
Neale Pickett 2022-06-26 10:55:28 -06:00
parent 2f8eab0b3b
commit e9584169d1
9 changed files with 66684 additions and 335595 deletions

View File

@ -108,6 +108,7 @@ 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);

386762
case/body.stl

File diff suppressed because it is too large Load Diff

15502
case/cap.stl

File diff suppressed because it is too large Load Diff

View File

@ -66,7 +66,7 @@ public:
this->ditDuration = 100; this->ditDuration = 100;
} }
void SetDitDuration(int duration) { void SetDitDuration(unsigned 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(int d); virtual void SetDitDuration(unsigned 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,8 +16,8 @@ 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;

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_50K, FREQ_MODE_NONE); this->qt = Adafruit_FreeTouch(pin, OVERSAMPLE_2, RESISTOR_0, FREQ_MODE_SPREAD);
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/2; return val > QT_THRESHOLD;
} }

View File

@ -3,7 +3,7 @@
#include <Adafruit_FreeTouch.h> #include <Adafruit_FreeTouch.h>
#include "bounce2.h" #include "bounce2.h"
#define QT_THRESHOLD 850 #define QT_THRESHOLD 450
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 550 #define TONE 3000
#define MILLISECOND 1 #define MILLISECOND 1
#define SECOND (1 * MILLISECOND) #define SECOND (1 * MILLISECOND)