Go Down

Topic: Read this before posting a programming question ... (Read 74 times) previous topic - next topic

PeterH

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.
I only provide help via the forum - please do not contact me for private consultancy.

liudr

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.

Nick Gammon


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.


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.
http://www.gammon.com.au/electronics

Sacman

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:

http://www.youtube.com/playlist?list=PLA567CE235D39FA84&feature=plcp
Luck,

Wade

maniacbug

Here's my contribution, a collection of common beginner trouble spots: http://www.cprogramming.com/tutorial/common.html

Nick Gammon

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

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


Jack Christensen


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

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


I see there is also: http://www.parashift.com/c++-faq/

The few pages I checked appear identical between the two.  :~
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Tom Carpenter

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 :D
~Tom~

dkl65


Here's my contribution, a collection of common beginner trouble spots: http://www.cprogramming.com/tutorial/common.html

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?
Visit http://www.glenof.webs.com/!

AWOL

#25
Jul 04, 2012, 06:51 pm Last Edit: Jul 04, 2012, 06:56 pm by AWOL Reason: 1
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.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

dkl65


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

I once did this:
Code: [Select]

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

and got compiler errors unless I write the function before it is used.
Visit http://www.glenof.webs.com/!


Coding Badly

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

Nick Gammon

Done. I added a clarification that a sketch is a program/code.
http://www.gammon.com.au/electronics

Go Up