Pages: 1 [2]   Go Down
Author Topic: Error in running Tone tutorial  (Read 3244 times)
0 Members and 1 Guest are viewing this topic.
Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just tried it on my Vista 64bit machine, and Agusta's code, and the tutorial, compiled ok.
Logged

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

well, shoot! i wonder if it's a windows 7 issue....
has anybody else been able to get this to compile using windows 7?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 209
Posts: 13024
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


No problem with Windows 7 (64 bit).  This is what I did...

• Start Arduino IDE
• Navigate to the tone tutorial using my favourite web browser
• Click the first [Get Code] link...
   http://arduino.cc/en/Tutorial/Tone?action=sourceblock&num=1
• Press Ctrl + A to select the text
• Press Ctrl + C to copy the text
• Switch to the Arduino IDE
• Press Ctrl + V to paste
• Click the down-pointing arrow on the right side to display the Tab Menu
• Click New Tab
• Enter pitches.h and click OK
• Switch to the web browser
• Go back to the tutorial
• Click the second [Get Code] link...
   http://arduino.cc/en/Tutorial/Tone?action=sourceblock&num=2
• Press Ctrl + A to select the text
• Press Ctrl + C to copy the text
• Switch to the Arduino IDE
• Press Ctrl + V to paste
• Press Ctrl + R to verify

Logged

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

so i did it exactly the way you typed it out (using keyboard shortcuts and all) and found myself verifying the pitches.h file - which compiled. so then i changed tabs to verify the tone code.... and it compiled! and then i uploaded it, which went fine.
so does the moral of the story here state that i was supposed to compile pitches.h? would that have anything to do with it?
thanks a bunch for your help!
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 209
Posts: 13024
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

so does the moral of the story here state that i was supposed to compile pitches.h?

I'm guessing you're rather new to the world of compiled programming languages1.  When you Verify or Upload, various bits are combined together ultimately becoming an "upload image"2.  In compiled language parlance this is called a "build".  While both the sketch tab and the pitches.h tab are included in the build, only the sketch tab is fed directly to the compiler.  pitches.h is included indirectly / by reference.

In other words, it makes no difference which tab has the focus.  Only the sketch (the "main" tab) gets fed to the compiler.  You do not need to compile the other tabs (like pitches.h) before compiling the sketch tab.

Quote
would that have anything to do with it?

No.  At this point my suspicion is that the error message you encountered was a bit different than the original error message.  Precision with error messages is very (annoyingly!) important.

Quote
thanks a bunch for your help!

You are welcome!  Enjoy!



1 This is not meant as an insult but merely an observation and precursor.
2 Other names are also used.  HEX-file is a fairly common synonym.
Logged

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

okay, so i'm getting the same issue again. and i think it's because i've saved the sketch with a different name? the successful compiling and uploading was before i bothered to name the sketch. if i save the sketch with the default name, it will still work. if i try to save the sketch with a specific name before i even add any code or anything, it still won't compile.
Logged

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

got it! it didn't like the name i gave it - "tone". i gave it a new name and all is swell.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 209
Posts: 13024
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Excellent and thank you for the follow-up.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
there's no place like 127.0.0.1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

got it! it didn't like the name i gave it - "tone". i gave it a new name and all is swell.

Thanks for the feedback.   smiley-lol

I have just been experiencing the exact same problem with my project.
I was (still am) upgrading a project from Arduino 0018 to Arduino 1.0
Besides a lot of old references to NewSoftSerial, Wprogram.h, print function where the BYTE switch has been removed, etc. I ran into this weird error.

The error message here looks like this:
Code:
main.cpp.o: In function `main':
C:\Program Files\arduino-1.0\hardware\arduino\cores\arduino/main.cpp:11: undefined reference to `setup'
C:\Program Files\arduino-1.0\hardware\arduino\cores\arduino/main.cpp:14: undefined reference to `loop'

It turns out that you cannot name your project 'Main' or 'main' - It just won't compile.

Renaming it to 'kjsgyilisj'  (random fist on the keyboard!!  smiley-eek-blue  )  -and the code compiles just fine


Sometimes... i get very very tired!!!   smiley-confuse
Logged

Pages: 1 [2]   Go Up
Jump to: