Pages: [1]   Go Down
Author Topic: Define function documentation in stealth mode..  (Read 1075 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Its mid morning and I have been up all night playing with my first Arduino so please feel free to correct me if I am wrong.

I have searched and searched and cannot find any link to define function in the documentation  main page.

To make matters even more confusing, there is a link to 'Return' in the control structures section so I know how to return a value from my function, just no idea how to write the function to return something from smiley)

OK, I lied, I do know how to write it because I found the page with a google search. But having to google for the answer seems a somewhat long winded way to locate the page, surely it should be included in the main 'index' page for the reference!

I was going to include a link to the page in question but YaBB went into over protective mode and wouldn't let me in a first post so I will stick it in the next one smiley)
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is the reference page in case anyone else turns to this forum to try finding the answer.

http://www.arduino.cc/en/Reference/FunctionDeclaration
Logged

London, England
Offline Offline
Edison Member
*
Karma: 4
Posts: 1026
Go! Go! Arduinoooo !!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Louise - You are not alone. Searching for stuff on the forum and the website is goddam awful. There is a discussion on another thread about changing things and I really hope that something gets done about it this time.
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 124
Posts: 6652
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I dunno; I typed "function" in the search window of the main arduino page, and the FunctionDeclaration reference page you mention was the first hit.  (it's been recently edited, perhaps keywords were added?)

Presumably it doesn't show up in the reference page because there is no specific keyword used to define a function in C, as there would be in many other languages...
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Presumably it doesn't show up in the reference page because there is no specific keyword used to define a function in C, as there would be in many other languages...

Maybe, but it Should be listed. It is one of the fundamental aspects of the language and as such really should be listed along side the listed 'return' statement :-S
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 124
Posts: 6652
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I guess I agree that it ought to be easier to find, but I don't see how to fit it into that rather "terse" form that the arduino reference currently uses.   I suppose it COULD be like:

subroutine:  arduino does not use a "subroutine" keyword when defining subroutines.  See "functions"
procedure:  arduino does not use a "procedure" keyword when defining subroutines.  See "functions"
deffn:  arduino does not use a "deffn" keyword when defining functions.  See "functions"

repeat ad nauseum for any synonym for a C function that someone might be familiar with from some other language?  Seems a bit ... open ended?
Logged

Norway@Oslo
Offline Offline
Edison Member
*
Karma: 12
Posts: 2033
loveArduino(true);
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.arduino.cc/playground/Code/Function

[ Thank you westfw for contributing to this page, and by doing so, reminded me of it. I've tried to add some more to it ]
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Given that the whole Arduino concept is supposedly an easy way for people to enter into the world of MC's and programmable 'gadgets', I would have thought a simple link something along the lines of..

Control Structures
   # if
   # if...else ......
   # Function definition
   # Return
....

would allow those who are just entering the game to find the page which already exists without having to resort to searching/ google/ finding a post in this forum.

It's all too easy to dismiss the need for help when you are at a level where you don't need it, but for those of us who have no idea about programming the arduino seeing a function in a sample sketch and then having to run the gauntlet of the internet to find out how the hell to use the facility find it extremely frustrating. Especially when eventually you find out the explanation is there but not linked!
Logged

Denver
Offline Offline
God Member
*****
Karma: 20
Posts: 779
Inactive - PM
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think something very similar to your example is the main page of the Reference. http://arduino.cc/en/Reference/Extended

Personally I never expected this site to teach me C/C++. To the great extent that it did, I see as a perk.

Other than the functions that are unique to AVR/Arduino (which are well documented) you can use just about any reference (book or web site) to fine applicable solutions to matters of programming. IMO

  
Logged

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 267
dinosaur cork
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This reference was part of the official Arduino documentation, on the language page, for about year, until Arduino management decided that it shouldn't be part of the language page documentation anymore.

http://www.arduino.cc/en/Reference/FunctionDeclaration

I believe it was banished to the Foundations page, which is something of backwater off the Learning page. The management and I had an extended disagreement about including a top level link to the Foundations page off the reference page, with the result being that the top level link would be redundant and could not be included at the top of the reference page.

Of course there are many resources for learning C, but it happens that lots of students start working with the Arduino without having coded in C before. So I believe that more of this support material is justified.

I believe it is also easier for students to see examples in the environment in which they are coding. Others however apparently disagree.

paulb



« Last Edit: June 14, 2009, 06:57:30 pm by paulb » Logged

Pages: [1]   Go Up
Jump to: