Help with making a loop.. Within

d

void loop() {
  if(Serial.available() > 0) 
  {
  {   state = Serial.read();   
      flag=0;
    }

The Arduino team spent a great deal of effort on the Tools + Auto Format tool to make your code readable. Why can't you use it?

Why are there extra curly braces in the code? They don't make you look smarter.

I tried some ways and it didn't work?

Is this a question? It looks like one. It seems to me that you are the only one that can answer that question.

What are some of the ways you tried? What does "it didn't work" mean?

PaulS:
The Arduino team spent a great deal of effort on the Tools + Auto Format tool to make your code readable. Why can't you use it?

Why are there extra curly braces in the code? They don't make you look smarter.

What are some of the ways you tried? What does "it didn't work" mean?

Why are you so ignorant and cocki on every post? do you think you're better than everyone? sitting behind a computer acting all smart, is this your way of making yourself look smart?. How about you leave this post go dig yourself a hole and sit in it then cover it up and stay there.

Whilst Paul's style of reply may not suit everyone he makes some good points.

  1. Please format the code so that it can be read more easily. The Auto Format option in the Tools menu does this for you.

  2. The extra curly braces are not necessary and only serve to clutter up the code.

  3. If you describe what you tried and what happened it will be easier to track down the problem(s)

husein06:
Why are you so ignorant and cocki on every post? do you think you're better than everyone? sitting behind a computer acting all smart, is this your way of making yourself look smart?. How about you leave this post go dig yourself a hole and sit in it then cover it up and stay there.

If Paul wouldn't have said the comments, someone else would have. I think he was pretty calm in his replies.. And yes, he is the one member to listen to when it comes to the code.