Compiling errors on nearly every ino or pde code

Why is it that when i compile pde or ino sketches from nearly every site including this one it always says compiling error, why are these sketches even posted online if none will compile, i like arduino but this makes me want to use other platforms instead which are more costly but more realiable, got a friend to try on hers and same thing.

Do the "examples" from your installation of Arduino all run? If so, then you are likely missing some libraries for the code you find in the forum.

Often, on this forum, the examples are not complete, that is they are snippets of code intended to show an approach or solution to a specific issue.

We encourage all posters to post full code but this rarely happens. And remember, the posted code most often has bugs which is why they are posting!

Full working code can be found in the Exhibition section of the forum.

Ray
My Projects

In many cases older examples were written before the release of Arduino 1.0 and use some syntax no longer supported. Often they use the older "WProgram.h" or "WConstants.h" (or similar Wiring file) in place of the modern "Arduino.h" and that is the only change needed.

You're probably skip reading the pages you download from. If you pay attention to the other words on the page (rather than just cut and paste the code), you'd probably find the instructions concerning installation of libraries etc..

Why is it that when i compile pde or ino sketches from nearly every site including this one it always says compiling error ...

Yes, but personally I find all the examples that ship with the IDE work.

So to get a useful response, you need to quote the exact sketch. Post it, or link to it, making clear exactly which one you tried. And state what Arduino you have, there are quite a few now.

... more costly but more realiable ...

Well, maybe. But this is pure speculation, right?

stefi01:
Why is it that when i compile pde or ino sketches from nearly every site including this one it always says compiling error, why are these sketches even posted online if none will compile, i like arduino but this makes me want to use other platforms instead which are more costly but more realiable, got a friend to try on hers and same thing.

Your post is coming across as "sledging" or simply an attack on the Arduino without a single fact to back it up.

What Arduino do you have?
What .pde or .ino sketches?
What "nearly every" site?
What "compiling error"?
What "other platforms" are "more reliable"?
What "friend"?

If you don't answer promptly I will delete your posts and account on the basis that they are a completely unsubstantiated attack on the Arduino, possibly by a rival company.

How to use this forum

[quote author=Nick Gammon link=msg=2073283 date=1422951728]
If you don't answer promptly I will delete your posts and account on the basis that they are a completely unsubstantiated attack on the Arduino, possibly by a rival company.
[/quote]Surely not! He has a friend that tried hers (at his suggestion).

I wonder if this friend of his would have tried hers if he HADN'T suggested she try it?

I bet she was quite content with her Arduino UNTIL he got her to try it.

Hi, can you check and make sure you are compiling for the UNO.
Can you post the errors you are getting so we can find the solution to your problem.
What version is your IDE?

Tom...... :slight_smile:

stefi01:
Why is it that when i compile pde or ino sketches from nearly every site including this one it always says compiling error, why are these sketches even posted online if none will compile, i like arduino but this makes me want to use other platforms instead which are more costly but more realiable, got a friend to try on hers and same thing.

Lame-o try to create a flame war on the Arduino platform?

Or what?

When trying to compile an Arduino sketch, you would have to watch out for

  • Arduino IDE version number
  • Board used (UNO, MEGA, LEONARDO etc.)
  • Libraries needed

I.e. all "pde" Sketches are totally timed out. The file ending .pde was used for Arduino versions BEFORE 1.0 version number.

All current sketches for Arduino 1.0 and above are .ino sketches.

So if you don't know anything about Arduino and your IDE version number is above 1.0, don't try with .pde sketches but always look out for .ino sketches!

The next thing is the board: Due to different hardware, sketches may not be fully compatible to different boards than the board they were written for.

And last but not least: Libraries!
Many sketches not only use libraries that are included in the IDE, but different third-party libraries. You can see that from lines at the top of the code like

#include "RTClib.h" // Credit: Adafruit RTC_DS1307 RTC

If your sketch needs any additional third-party libraries, you MUST INSTALL THE LIBRARIES NEEDED FIRST, before you can compile the sketch.

Otherwise the GIGO principle will take place with your programming:
Garbage In ---> Garbage Out
And that's most likely the error message that you see.

That's totally normal.
Not only with Arduino, but also "other platforms instead which are more costly".