Read this before posting a programming question ...

Thumbs up from me.

If you are going to suggest that people use 115200 baud for serial comms, it might be worth mentioning that they will need to set the serial monitor to match. It's not necessarily obvious for beginners, and could save on 'My serial output is just weird characters' problems.

1 Like

I think this was very useful, 2 questions answered (of mine) - I was wondering about char arrays and sram, since most boards (the cheaper ones not the mega boards) only have 2k of sram, this post would save someone a LOT of time lol.... cheers - i hope it stays sticky.

Yeah I hope so too ... but I am just a Pawn in the Game of Life ...

Excellent!

The "what have you tried" link alone doubles the usefulness of the post. :smiley:

When posting code, rather than posting a complex sketch, aim to post the simplest sketch that shows the problem. As a courtesy to the people trying to help you, make sure the sketch actually compiles and demonstrates the problem before you post it, and format the code.

Nice post Nick! My suggestion: Add number to each bold title so I can tell a noob to say read number 6 on the sticky thread about "getting help" and follow the "posting code" suggestion. Or simply issue a 6-5.

PeterH:
When posting code, rather than posting a complex sketch, aim to post the simplest sketch that shows the problem.

Added this suggestion to the "how to post" list.

liudr:
My suggestion: Add number to each bold title so I can tell a noob to say read number 6 on the sticky thread about "getting help" and follow the "posting code" suggestion.

Now numbered each section.

Jeremy Blum's tutorial series on Youtube is the single most helpful resource for anyone just getting started using the Arduino.

I watched all 14 videos twice before I even received my Arduino in the mail. I think everyone should be required to watch those videos before they post a thing:

2 Likes

Here's my contribution, a collection of common beginner trouble spots: 8 Common Programming Mistakes - Cprogramming.com

1 Like

Thanks! And I'll add the C++ FAQ Lite:

http://www.parashift.com/c++-faq-lite/

Nice.

I see there is also: C++ FAQ

The few pages I checked appear identical between the two. :~

Another thing, if the code being posted is not properly indented, it is a pain to follow. Press "tools->auto format" in the IDE first as it makes it far easier to understand :smiley:

maniacbug:
Here's my contribution, a collection of common beginner trouble spots: 8 Common Programming Mistakes - Cprogramming.com

In section 5 of your link, it says that you have to declare the functions first. Why don't I have to do that in Arduino?

1 Like

Because the Arduino pre-preprocessing does it for you, most of the time.
Sometimes, like functions with references as parameters, it doesn't work too well.

AWOL:
Sometimes, like functions with references as parameters, it doesn't work too well.

I once did this:

void timer(unsigned long interval, void (*g)()){
  //...
}

and got compiler errors unless I write the function before it is used.

1 Like

You may also point to this collection of libs: Arduino Playground - LibraryList

Post your code!

Please change that to "Post your complete sketch!" Too many people post snippets of code that have nothing to do with the actual problem.

Done. I added a clarification that a sketch is a program/code.