¿ªÔÆÌåÓý

Re: Getting stuck


Jack Purdum
 

Erik:

At several places in your code you have if expressions like:

? ? if (vfo >= 10000000L & tbfo != "USB")

A single ampersand is the bitwise AND operator but you probably want the logical AND operator, which is &&. My unit is in pieces so I can't test it, but see if that makes a difference. Also, it appears that a button push changes the increment by a multiple of 10. Could this switch statement block
:
? ? switch (radix)
? ? {
? ? ? case 10:
? ? ? ? radix = 100;
? ? ? ? break;
? ? ? case 100:
? ? ? ? radix = 1000;
? ? ? ? break;
? ? ? case 1000:
? ? ? ? radix = 10000;
? ? ? ? break;
? ? ? case 10000:
? ? ? ? radix = 100000;
? ? ? ? break;
? ? ? case 100000:
? ? ? ? radix = 10;
? ? ? ? break;
? ? }

be replaced with:

? ? radix *= 10; ? ? ? ? ? ? ? ?// Multiply by 10
? ? if (radix > 100000L) ? // Too big?
? ? ? ? radix = 10; ? ? ? ? ? ? // Wrap around to start value

Also, my Fast Tune could be substituted, thus doing away with the button on pin 11. (I think I've already posted the code here.) Finally, use Ctrl-T in the Arduino IDE to reformat your code to a more common style. Sometimes that makes debugging easier.


Jack, W8TEE


From: Eric Torraca <eric.torraca@...>
To: [email protected]
Sent: Sunday, February 26, 2017 5:52 PM
Subject: [BITX20] Getting stuck

Good evening folks.

I'm hoping someone out there can give another assist with the Arduino code. I'm getting pretty frustrated with this thing and I just can't find the part(s) of the code I'm getting wrong. I'm sure it's something basic. I just can't see it.
I'm working with a non-raduino Bitx40 (#80!) and am trying to tune it with an Adafruit Si5351, rotary encoder, and a Arduino nano. I'll attach code, taken from AK2B's blog, below.
The two issues I'm having are:
1) I cannot seem to put the right numbers in the code to get the rig on frequency. I've measured my Bix40 BFO at around 11.97MHz, so the Si5351 should be running around 4.97MHz on clock 0 correct? No matter where I put those numbers I cannot get in the band. I was able to receive signals today but there was nothing I could find that would give me a good fix. It's pretty much deaf to the LC VFO for the 40 DC receiver I've got in parts on the desk next to it. This is beginning to drive me up a wall.
2) while you all were kind enough to help before, and the frequency readout on the LCD does change when the encoder is turned, the actual frequency does not until the button that changes the increment is pushed (the encoder does not have an integral button). I've tried adding the display_frequency() command in a couple places (as you can probably see below) to see if the sequence made a difference, but it doesn't seem to change the behavior.?
So those are the issues. Like I said, I'm sure I'm betraying my ignorance of something simple, but I've run out of ideas at this point. The code below is probably as much an illustration of that as could be. My apologies to it's original author.
73 de KB1VNA
Eric




Join [email protected] to automatically receive all group messages.