Pages: [1]   Go Down
Author Topic: Help with making a loop.. Within  (Read 314 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

d
« Last Edit: April 21, 2013, 05:25:05 pm by husein06 » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 50243
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
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.

Quote
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?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

East Anglia (UK)
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4334
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

USA, FL
Offline Offline
God Member
*****
Karma: 14
Posts: 689
A life? Where can I download one of those?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 
Logged

//LiNK

Pages: [1]   Go Up
Jump to: