Pages: [1]   Go Down
Author Topic: I can't get the tone library to load !!urgent!!  (Read 2269 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
« Last Edit: April 08, 2012, 03:59:28 am by Nick Gammon » Logged

Scotland
Offline Offline
Edison Member
*
Karma: 25
Posts: 1314
Have you had your Arduino fix today?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

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

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

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

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6146
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Download Arduino Pre-1.0 (0023 or 0022).
Logged

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

Scotland
Offline Offline
Edison Member
*
Karma: 25
Posts: 1314
Have you had your Arduino fix today?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi - YOU have to make it - use notepad in windows or whatever its called in linux.
Logged

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

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 484
Posts: 18764
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Make a file: WProgram.h

Put in it:

Code:
#include <Arduino.h>

Put it where he said.
Logged


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

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
Logged

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

srry teamviewer or skype???
Logged

Scotland
Offline Offline
Edison Member
*
Karma: 25
Posts: 1314
Have you had your Arduino fix today?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

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

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

OMFG it worked THANK U SOOO MUCH !!
Logged

Pages: [1]   Go Up
Jump to: