开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Tuning knob switch as step change focus #sBITX_v3


 

I noticed that the encoder1 switch was used for setting focus to the volume control but the encoder2 switch wasn’t used for anything.?
I decided that changing the tuning step size would be handy so I added following code to the sbitx.gtk.c file:
Right below this:

if (digitalRead(ENC1_SW) == 0)
? ? ? ? ? ? ? focus_field(get_field(”r1:volume”));

i added:

if (digitalRead(ENC2_SW) == 0)
? ? ? ? ? ? ? focus_field(get_field(”#step”)

all the code necessary beyond this was already there. I just press the tuning knob to step to the next step or use options knob.


 

As a secondary function of the main tuning encoder, I would like to see a long press lock all functions of the radio especially tuning.

Joel
N6ALT


 

I too was looking for a use of the main tuning knob button and my own software for my home brew bitx20 ?uses this very approach.?


Just one problem with the code though, unless I have read it incorrectly. Once pressed, the Frequency Step field will cycle through all of the step options until the button is released. By adding a check to see if the button is already pressed, this can be avoided:-

add the following in variables section of the sbitx_gtk.c file :-

static bool boolENC2Press = false;


then add the following code as described by Tom with a slight modification:-

if (digitalRead(ENC2_SW) == 0){
? ? ? ? if (!boolENC2Press)

? ? ? ? ? ? ?focus_field(get_field(“#step”));
? ? ? ? ? ? ?boolENC2Press = true;}
? ? ? ? else{

? ? ? ? ? ? ? boolENC2Press = false;}


Obviously, make a copy of the sbitx_gtk.c file before editing it.

once done, run the following from the sbitx folder :-

./build sbitx?

73
Dave - G4UFS


 

"?unless I have read it incorrectly. Once pressed, the Frequency Step field will cycle through all of the step options until the button is released"

Hi Dave,
Yes, that's true but why would you hold the button down? Clicking once increments the step size to the next level and sets the focus to the "Step" control. If anything the switch could benefit with a little bounce therapy. Other than that it works fine and to me adds a lot of convenience when tuning around and all for a minimum code investment.


 

Agreed Tom. I’m just a bit slow at releasing the button. ‘Could be my age :)


 

I agree, I can be slow at times releasing the button.

Another problem is accidentally twisting the button either as I begin to press it or as I release it.

One thing I'd like to see implemented is a mode where the function of the small knob returns to setting the audio level after some preset time, let's say three seconds.? I've often touched a field to gain 'focus' (to use the linux/x-windows terminology) and twisted the knob then forgotten (another symptom of age!) that it is in that other mode then want to change the audio level so I twist the small knob and screw things up.? I think it'd be helpful if it just reverted to setting the audio level after a few seconds.??

I was thinking of implementing this myself, but if someone else gets there first I would not be offended.

--
Regards,
Dave, N1AI


 

Dave, I agree with you, I have requested this feature twice already. It would be nice if the MFK returns to the 'Home' position after a preset time period. It would even be better if the 'Home' position could be programmable to any function by the user. Unfortunately I'm no coder so I will have to wait until somebody else does it.

Joel
N6ALT


 

“One thing I'd like to see implemented is a mode where the function of the small knob returns to setting the audio level after some preset time, let's say three seconds.“

That would be really helpful.?

Tom, ak2b


 

On Tue, Jan 2, 2024 at 03:30 PM, Joel Caulkins/N6ALT wrote:
Dave, I agree with you, I have requested this feature twice already. It would be nice if the MFK returns to the 'Home' position after a preset time period. It would even be better if the 'Home' position could be programmable to any function by the user. Unfortunately I'm no coder so I will have to wait until somebody else does it.
I didn't know that.? Great minds think alike!
?
--
Regards,
Dave, N1AI


 

On my V3 depressing the volume knob changes focus to volume no matter where it was.

Ron

On Tuesday, January 2, 2024 at 04:51:57 PM EST, Dave, N1AI <n1ai@...> wrote:


On Tue, Jan 2, 2024 at 03:30 PM, Joel Caulkins/N6ALT wrote:
Dave, I agree with you, I have requested this feature twice already. It would be nice if the MFK returns to the 'Home' position after a preset time period. It would even be better if the 'Home' position could be programmable to any function by the user. Unfortunately I'm no coder so I will have to wait until somebody else does it.
I didn't know that.? Great minds think alike!
?
--
Regards,
Dave, N1AI