Go Down

Topic: Flushing Arduino (Read 1 time) previous topic - next topic

Jimmy60


Code: [Select]
type=1;
  error=0;

I included this part so that code should run...before .. code wasn't working..I dont think there is error in this part.. :smiley-slim:


Sure there isn't really an error there but what Awol is getting at is that assigning a variable a value then immediately testing it for different values is pointless. That you had to assign values to these to make it work suggest that they aren't getting the values you think they should when they should.

I have found that when I start having to kludge things to make a program work I've got a problem somewhere.

Docedison

Quote
I have found that when I start having to kludge things to make a program work I've got a problem somewhere.

Some of the BEST advice ever offered. Something I had to learn the hard way... That there is only ONE successful method that is repeatable every time.
Today when I see someone's Kludge... I have to wonder If in my wanderings if I've ever done anything like that... and pray it had an early and painless death.
I guess the bottom line is that your work Should be dome in such a manner that you are proud to place your name on it in a prominent place. If Not... It's a Kludge.

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Nick Gammon

Code: [Select]
 
  type=1;
  error=0;
  if(error==0)
  {
    if(type==1)
    {
      // blah
    }

  }


Could certainly be simplified to:

Code: [Select]
// blah


Quote
... it started giving previous output along with present one ...


Maybe your code had a bug? You could simplify it.

Go Up