Define function documentation in stealth mode..

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

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

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

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.

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

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

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?

[ 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 ]

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

Function definition



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!

I think something very similar to your example is the main page of the Reference.

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

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.

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.