¿ªÔÆÌåÓý

Opps...pressed the wrong key!


Jack Purdum
 


I think I just saw another problem. The code:

      if(digitalRead(SW)){  //***If SW is true do the following.
           
           
           
            if (SW ==  HIGH);
 does not change the value of SW via the call to digital read. Because you have the definition of SW as:

    const int SW = 7
it can never change during the execution of the program. It is a pin number, not a variable. Therefore, any test on its value, like the if statement test above, will always be logic True. You probably need something like:

? ?int pin7State;

? ?// ?a bunch of code...

? ? ? if (pin7State = digitalRead(SW)) {
? ? ? ? ?if (pin7State == HIGH) {
? ? ? ? ? ? // Do whatever...
? ? ? ? ?}
? ? ? ?}

Jack, W8TEE


From: martin Fraser <riggerswa@...>
To: [email protected]
Sent: Monday, January 16, 2017 9:32 AM
Subject: [BITX20] dds vfo problems

Hi all?
i am trying to use this script
but when i check tho output freq from my?si5351 Adafruit board im only getting 1.8-2 mhz !!!!
can anyone who is good with arduino have a look please
regards Martin
VK6FEEE