Skip to content
Permalink
Browse files

add a learning mode where code is not transmitted into the air

  • Loading branch information...
vu3rdd committed Mar 9, 2019
1 parent 1ae2af5 commit 258daf3b88678629c9b4f358e8a167809f020b19
Showing with 47 additions and 19 deletions.
  1. +6 −6 ubitx_keyer.ino
  2. +33 −9 ubitx_menu.ino
  3. +8 −4 ubitx_v4.3_code.ino
@@ -148,7 +148,9 @@ void cwKeyer(void){
lastPaddle = 0;
bool continue_loop = true;
unsigned tmpKeyControl = 0;


int txMode = learn_cw_mode?LEARN_CW:TX_CW;

if( Iambic_Key ) {
while(continue_loop) {
switch (keyerState) {
@@ -194,7 +196,7 @@ void cwKeyer(void){

keyDown = 0;
cwTimeout = millis() + cwDelayTime * 10; //+ CW_TIMEOUT;
startTx(TX_CW);
startTx(txMode);
}
ktimer += millis(); // set ktimer to interval end time
keyerControl &= ~(DIT_L + DAH_L); // clear both paddle latch bits
@@ -240,8 +242,8 @@ void cwKeyer(void){
active_delay(delayBeforeCWStartTime * 2);

keyDown = 0;
cwTimeout = millis() + cwDelayTime * 10; //+ CW_TIMEOUT;
startTx(TX_CW);
cwTimeout = millis() + cwDelayTime * 10; //+ CW_TIMEOUT;
startTx(txMode);
}
cwKeydown();

@@ -270,5 +272,3 @@ void cwKeyer(void){
} //end of while
} //end of elese
}


@@ -247,6 +247,29 @@ void menuSplitToggle(int btn){
}
}

void menuSetupCWLearning(int btn) {
if (!btn) {
if (learn_cw_mode == true)
printLine2("Learn CW \x7E ON");
else
printLine2("Learn CW \x7E OFF");
}
else {
if (learn_cw_mode == false) {
learn_cw_mode = true;
printLine2("LearnCW: true");
} else {
learn_cw_mode = false;
printLine2("LearnCW: false");
}

active_delay(500);
printLine2("");
updateDisplay();
menuOn = 0;
}
}

int menuCWSpeed(int btn){
int knob = 0;
int wpm;
@@ -686,21 +709,23 @@ void doMenu(){
else if (select < 60)
menuCWSpeed(btnState);
else if (select < 70)
menuSetupCWLearning(btnState);
else if (select < 80)
select += menuSetup(btnState);
else if (select < 80 && !modeCalibrate)
else if (select < 90 && !modeCalibrate)
menuExit(btnState);
else if (select < 90 && modeCalibrate)
menuSetupCalibration(btnState); //crystal
else if (select < 100 && modeCalibrate)
menuSetupCarrier(btnState); //lsb
menuSetupCalibration(btnState); //crystal
else if (select < 110 && modeCalibrate)
menuSetupCwTone(btnState);
menuSetupCarrier(btnState); //lsb
else if (select < 120 && modeCalibrate)
menuSetupCwDelay(btnState);
menuSetupCwTone(btnState);
else if (select < 130 && modeCalibrate)
menuReadADC(btnState);
menuSetupCwDelay(btnState);
else if (select < 140 && modeCalibrate)
menuSetupKeyer(btnState);
menuReadADC(btnState);
else if (select < 150 && modeCalibrate)
menuSetupKeyer(btnState);
else
menuExit(btnState);
}
@@ -712,4 +737,3 @@ void doMenu(){

checkCAT();
}

@@ -186,6 +186,7 @@ int count = 0; //to generally count ticks, loops, etc
//these are the parameter passed to startTx
#define TX_SSB 0
#define TX_CW 1
#define LEARN_CW 2

char ritOn = 0;
char vfoActive = VFO_A;
@@ -194,6 +195,7 @@ unsigned long vfoA=7150000L, vfoB=14200000L, sideTone=800, usbCarrier;
char isUsbVfoA=0, isUsbVfoB=1;
unsigned long frequency, ritRxFrequency, ritTxFrequency; //frequency is the current frequency on the dial
unsigned long firstIF = 45000000L;
bool learn_cw_mode = false;

//these are variables that control the keyer behaviour
int cwSpeed = 100; //this is actuall the dot period in milliseconds
@@ -317,8 +319,10 @@ void setFrequency(unsigned long f){

void startTx(byte txMode){
unsigned long tx_freq = 0;

digitalWrite(TX_RX, 1);

if (txMode != LEARN_CW) {
digitalWrite(TX_RX, 1);
}
inTx = 1;

if (ritOn){
@@ -343,7 +347,7 @@ void startTx(byte txMode){
setFrequency(frequency);
}

if (txMode == TX_CW){
if (txMode == TX_CW) {
//turn off the second local oscillator and the bfo
si5351bx_setfreq(0, 0);
si5351bx_setfreq(1, 0);
@@ -634,7 +638,7 @@ void setup()

//we print this line so this shows up even if the raduino
//crashes later in the code
printLine2("uBITX v4.3");
printLine2("uBITX v4.3a");
//active_delay(500);

// initMeter(); //not used in this build

0 comments on commit 258daf3

Please sign in to comment.
You can’t perform that action at this time.