Pages: [1]   Go Down
Author Topic: Tone Error Message  (Read 1562 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So I'm new to Arduino and using it, and am trying to just learn the basics of programming an Arduino for a future project. I went and looked and copied the program for tone along with making the pitches.h file in the tutorials section of the Arduino website. It gives me this error:

sketch_nov04a.cpp:18:22: error: pitches.h: No such file or directory
sketch_nov04a:21: error: 'NOTE_C4' was not declared in this scope
sketch_nov04a:21: error: 'NOTE_G3' was not declared in this scope
sketch_nov04a:21: error: 'NOTE_G3' was not declared in this scope
sketch_nov04a:21: error: 'NOTE_A3' was not declared in this scope
sketch_nov04a:21: error: 'NOTE_G3' was not declared in this scope
sketch_nov04a:21: error: 'NOTE_B3' was not declared in this scope
sketch_nov04a:21: error: 'NOTE_C4' was not declared in this scope

What have I done wrong?
Logged

Leeds, England, (dis)UK
Offline Offline
God Member
*****
Karma: 16
Posts: 707
Quick, chuck it in the bin before the boss finds out...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The first line of the error messages tells you what is wrong - it cannot find pitches.h. Have you downloaded it and installed it in the correct location?
Logged

Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

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

No I haven't. Like I said, I'm new at this and didn't know that had to be done. Do I just download the tone library to the libraries folder?
Logged

Leeds, England, (dis)UK
Offline Offline
God Member
*****
Karma: 16
Posts: 707
Quick, chuck it in the bin before the boss finds out...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need pitches.h, pitches.cpp and possibly keywords.txt. Put these in the libraries folder in the same directory as your sketches.
Logged

Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

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

Thank you for helping so far, but there are more problems yet. Because I could not find a pitch library, I downloaded the Tone library, and tried that. Where before in the code there was "pitches.h" I just changed pitches to tone and got a whole new set of error messages:

C:\Program Files (x86)\arduino-1.0.1\libraries\Tone\Tone.cpp: In member function 'void Tone::begin(uint8_t)':
Tone:117: error: 'bitWrite' was not declared in this scope
Tone:119: error: 'digitalPinToPort' was not declared in this scope
Tone:119: error: 'portOutputRegister' was not declared in this scope
Tone:120: error: 'digitalPinToBitMask' was not declared in this scope
C:\Program Files (x86)\arduino-1.0.1\libraries\Tone\Tone.cpp: In member function 'void Tone::play(uint16_t, uint32_t)':
Tone:194: error: 'OUTPUT' was not declared in this scope
Tone:194: error: 'pinMode' was not declared in this scope
Tone:290: error: 'bitWrite' was not declared in this scope
C:\Program Files (x86)\arduino-1.0.1\libraries\Tone\Tone.cpp: In member function 'void Tone::stop()':
Tone:357: error: 'digitalWrite' was not declared in this scope

Do you have any idea what's going on here?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 50243
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I downloaded the Tone library, and
put it in the wrong place. Only core libraries go in that folder. User downloaded libraries go in the libraries folder of the sketch directory. Don't have one? Make one!
Logged

Leeds, England, (dis)UK
Offline Offline
God Member
*****
Karma: 16
Posts: 707
Quick, chuck it in the bin before the boss finds out...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I can't be certain because I can't see your code, but I would guess that you are trying to access functions that are in the pitches library but aren't in the tones one?
Logged

Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

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

Ok, so i turns out that in the examples folder in the Arduino folder there is this program with the pitches.h file by it, and get what I should have done, and I now know that the .h is just a text file. Thank you for helping me with this.
Logged

Pages: [1]   Go Up
Jump to: