Go Down

Topic: Tone Error Message (Read 1 time) previous topic - next topic

WarlockJK

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?

dannable

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?
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

WarlockJK

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?

dannable

You need pitches.h, pitches.cpp and possibly keywords.txt. Put these in the libraries folder in the same directory as your sketches.
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

WarlockJK

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?

Go Up