¿ªÔÆÌåÓý

Flutter Fix


 

It's working now. It was just that I removed the three tokens at the bottom of that section of code. And Jerry said to remove two, like he has in his snippet, and leave the original one after pasting over the original section.

The original Raduino code compiled fine. But it was that mistake that gave me a error somewhere else in the code. And I couldn't make the connection.

When is this Amateur Radio learning gonna stop. It's too deep and wide for one lifetime. Like the carrot says "It's YUGE".


 

?Jerry Gaffke-

I have uploaded the modified sketch and it works great. I can properly tune a freq without fiddling with it to make it stop flicker fluttering. It works the same as the original except for the new tuning stability.

I don't know how there could be a downside, or what the trade off could be. But I think this should be included in the Raduino revision.

This is the whole section I replaced-

? // the tuning knob is at neither extremities, tune the signals as usual

? else if (knob != old_knob){

? ? ?frequency = baseTune + (50l * knob);

? ? ?old_knob = knob;

? ? ?setFrequency(frequency);

? ? ?updateDisplay();

? }

}

This is what I replaced it with, leaving the last one of the three braces "}" in this section of the original Raduino_code. It comes after the last one you see in this snippet.?

 // the tuning knob is at neither extremities, tune the signals as usual
  else if (knob != old_knob){
    static char dir_knob;
    if ( (knob>old_knob) && ((dir_knob==1) || ((knob-old_knob) >5)) ||
         (knob<old_knob) && ((dir_knob==0) || ((old_knob-knob) >5)) )   {
       if (knob>old_knob) {
            dir_knob=1;
            frequency = baseTune + (50l * (knob-5));
       } else {
            dir_knob=0;
            frequency = baseTune + (50l * knob);
       }
       old_knob = knob;
       setFrequency(frequency);
       updateDisplay();
    }
  }


 

Thanks for trying out my flutter fix!

The snippet with my new code in your last post is correct. ?Note that all "{" have a matching "}" further down in the code. ?But your code snippet showing the old code that you replaced is not correct, it has an extra "}" at the very end.

As you have likely figured out, hacking Arduino code is going to be a big part of playing with this radio. ?Will not be a mistake to invest some time in figuring out how. ?Sounds like Jack may have found you a book to read, a very good start. ?Arduino code is actually C, which is widely used and the only language I ever use for low level programming like this.

A bit off topic, not appropriate for a Nano, but once you have C figured out you might take a look at the Python Tutorial: ??? ? I'm lost and bereft if I don't have python handy on my laptop for quick calculations, the usual calculator gui that comes on most computers is stupid and clunky in comparison. ?And python can do far more than replace that calculator gui, it's a full fledged modern language, easy to learn, very powerful.

Jerry


On Thu, Feb 23, 2017 at 03:57 pm, John Smith wrote:

This is the whole section I replaced-

? // the tuning knob is at neither extremities, tune the signals as usual

? else if (knob != old_knob){

? ? ?frequency = baseTune + (50l * knob);

? ? ?old_knob = knob;

? ? ?setFrequency(frequency);

? ? ?updateDisplay();

? }

}

?


 

The end of the original code section had 3 of those braces. Just taking out the first two and leaving the third, then pasting over with your code seemed to make it happy.

I have seen the intro info about the Raspberry PI, and how the creator wanted kids of today to enjoy the programming fun he had back in the Commodore 64 days. Those were my days too. But the programming, not so much. It was a different language than they were teaching in my High School class. Middle age is a hard place to start this new stuff. But if I was a kid today, it would be second nature if not the first.

Keep telling people about the flutter solution. Things get lost to new people when the topic rolls off from the top of the list.


 

I just wanted to say one more thing. I ordered two big 4cm knurled shaft knobs for a smaller tuning pot because of the flakey frequency flutter that needed a delicate touch and patience. The flutter fix code enhancement makes it so I can use a regular 1.5cm knob without any problems in adjusting the tuning. And it helps to save some space on your front panel. Like I said before, it works the same, but without the flutter.

I believe this should be your first hack to improve it's usability.

And Jerry could upload a "Flutter Fixed" version of Raduino_code to make it easier for newbies to try out.

Or if Farhan likes it, he can include it in a revised version of the Raduino_code. And maybe the calibration save and keep code fix too?