Go Down

Topic: Problem with reading voltages and possible code faults. (Read 807 times) previous topic - next topic

Cybernetician

Oops but not a big problem

Use Pin 0 (to blink led) to check if() statements

first time in this
Code: [Select]
if (finalval >= 700) {Blink}

and so on one by one


From Idea To Invention

buteman

I think your code in setup()

Code: [Select]

if (finalval >= 700) {
    Serial.print("Greater Than 700");
    buzz = 591;
    cut = 570;
  }
  else if ( finalval >= 450) {
    Serial.print("Greater Than 450");
    buzz = 398;
    cut = 367;
  }


will always set buzz to 398 and cut to 367.
although I am usually wrong :smiley-roll:

Arrch


I think your code in setup()

Code: [Select]

if (finalval >= 700) {
    Serial.print("Greater Than 700");
    buzz = 591;
    cut = 570;
  }
  else if ( finalval >= 450) {
    Serial.print("Greater Than 450");
    buzz = 398;
    cut = 367;
  }


will always set buzz to 398 and cut to 367.
although I am usually wrong :smiley-roll:


Not with the "else if" there.

Go Up