Go Down

Topic: I can't get the tone library to load !!urgent!! (Read 2994 times) previous topic - next topic

Apr 08, 2012, 04:50 am Last Edit: Apr 08, 2012, 10:59 am by Nick Gammon Reason: 1
I found a code online for the mario theme song
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1253920105
it supposable works fine but when I load it on my pc it wont compile gives me these errors
C:\Users\Harjit\Documents\Arduino\libraries\Tone\Tone.cpp:26:20: error: wiring.h: No such file or directory
C:\Users\Harjit\Documents\Arduino\libraries\Tone\Tone.cpp: In member function 'void Tone::begin(uint8_t)':
C:\Users\Harjit\Documents\Arduino\libraries\Tone\Tone.cpp:121: error: 'bitWrite' was not declared in this scope
C:\Users\Harjit\Documents\Arduino\libraries\Tone\Tone.cpp:123: error: 'digitalPinToPort' was not declared in this scope
C:\Users\Harjit\Documents\Arduino\libraries\Tone\Tone.cpp:123: error: 'portOutputRegister' was not declared in this scope
C:\Users\Harjit\Documents\Arduino\libraries\Tone\Tone.cpp:124: error: 'digitalPinToBitMask' was not declared in this scope
C:\Users\Harjit\Documents\Arduino\libraries\Tone\Tone.cpp: In member function 'void Tone::play(uint16_t, uint32_t)':
C:\Users\Harjit\Documents\Arduino\libraries\Tone\Tone.cpp:198: error: 'OUTPUT' was not declared in this scope
C:\Users\Harjit\Documents\Arduino\libraries\Tone\Tone.cpp:198: error: 'pinMode' was not declared in this scope
C:\Users\Harjit\Documents\Arduino\libraries\Tone\Tone.cpp:294: error: 'bitWrite' was not declared in this scope
C:\Users\Harjit\Documents\Arduino\libraries\Tone\Tone.cpp: In member function 'void Tone::stop()':
C:\Users\Harjit\Documents\Arduino\libraries\Tone\Tone.cpp:361: error: 'digitalWrite' was not declared in this scope




btw i have check the sketchbook location and its all there , also i already put the tone file into the library (properly)


please respond in a way a new programmer would understand thanx

Moderator edit: Got rid of all-caps subject. (Nick Gammon)

spycatcher2k

Add a file to C:\{path to arduino}\arduino-1.0\hardware\arduino\cores\arduino called WProgram.h - edit it and add the line : #include <Arduino.h>

See if that helps
Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

where to i get the file from ?????
(if this is a dumb question srry im new)

James C4S

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

spycatcher2k

Hi - YOU have to make it - use notepad in windows or whatever its called in linux.
Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

Nick Gammon

Make a file: WProgram.h

Put in it:

Code: [Select]
#include <Arduino.h>

Put it where he said.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

ok I tried everything you guys said and it still did not work to me it looks like the program cant find  the tone library
I tried changing my sketchbook location , reinstalling latest vesion etc still no luck(and i tried the things you yold me to do)


does anyone who knows about this stuff have team view if you could help me that would be awsome


spycatcher2k

Hi - in your library - find the file called Tone.cpp find the line near the top '#include <wiring.h>' & change it to #include <Arduino.h>
save it. then load the IDE , load the example, and it compiles.

Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly


Oacc2k

Hi guys,

I also did the changes, but get this:

core.a(main.cpp.o): In function `main':
C:\arduino-1.0.5-r2\hardware\arduino\cores\arduino/main.cpp:11: undefined reference to `setup'
C:\arduino-1.0.5-r2\hardware\arduino\cores\arduino/main.cpp:14: undefined reference to `loop'

Please any help.

spycatcher2k

Please post the code you are trying to compile.
Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

AWOL

How can this be "urgent!!" ?
This thread's over two years old.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up