Loading...
Pages: 1 [2]   Go Down
Author Topic: Read this before posting a programming question ...  (Read 33035 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Tesla Member
***
Karma: 89
Posts: 6400
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Central MN, USA
Offline Offline
Faraday Member
**
Karma: 35
Posts: 5941
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Global Moderator
Melbourne, Australia
Offline Offline
Shannon Member
*****
Karma: 219
Posts: 13896
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Cleveland, TN
Offline Offline
Full Member
***
Karma: 2
Posts: 207
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Luck,

Wade

Seattle, WA
Offline Offline
God Member
*****
Karma: 4
Posts: 673
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Global Moderator
Melbourne, Australia
Offline Offline
Shannon Member
*****
Karma: 219
Posts: 13896
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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


Florida, Winter Springs
Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice.
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 43
Posts: 2518
"We're a proud service of the Lost Electricity Reclamation Agency"
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Get the infamous "One Million Ohms" board at tINDIE.com: http://tinyurl.com/BuyMohms

Leeds, UK
Offline Offline
God Member
*****
Karma: 35
Posts: 988
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

~Tom~

Offline Offline
Sr. Member
****
Karma: 0
Posts: 451
I am a amateur.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: July 04, 2012, 11:56:58 am by AWOL » Logged

Pete, it's a fool looks for logic in the chambers of the human heart.

Offline Offline
Sr. Member
****
Karma: 0
Posts: 451
I am a amateur.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sometimes, like functions with references as parameters, it doesn't work too well.
I once did this:
Code:
void timer(unsigned long interval, void (*g)()){
  //...
}
and got compiler errors unless I write the function before it is used.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You may also point to this collection of libs: http://arduino.cc/playground/Main/LibraryList
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 120
Posts: 10184
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Melbourne, Australia
Offline Offline
Shannon Member
*****
Karma: 219
Posts: 13896
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Pages: 1 [2]   Go Up
Print
 
Jump to: