C:\Users\yoshito\arduino-1.0\libraries\Tone\Tone.cpp:26:20: error: wiring.h: No such file or directory
C:\Users\yoshito\arduino-1.0\libraries\Tone\Tone.cpp: In member function 'void Tone::begin(uint8_t)':
C:\Users\yoshito\arduino-1.0\libraries\Tone\Tone.cpp:121: error: 'bitWrite' was not declared in this scope
C:\Users\yoshito\arduino-1.0\libraries\Tone\Tone.cpp:123: error: 'digitalPinToPort' was not declared in this scope
C:\Users\yoshito\arduino-1.0\libraries\Tone\Tone.cpp:123: error: 'portOutputRegister' was not declared in this scope
C:\Users\yoshito\arduino-1.0\libraries\Tone\Tone.cpp:124: error: 'digitalPinToBitMask' was not declared in this scope
C:\Users\yoshito\arduino-1.0\libraries\Tone\Tone.cpp: In member function 'void Tone::play(uint16_t, uint32_t)':
C:\Users\yoshito\arduino-1.0\libraries\Tone\Tone.cpp:198: error: 'OUTPUT' was not declared in this scope
C:\Users\yoshito\arduino-1.0\libraries\Tone\Tone.cpp:198: error: 'pinMode' was not declared in this scope
C:\Users\yoshito\arduino-1.0\libraries\Tone\Tone.cpp:294: error: 'bitWrite' was not declared in this scope
C:\Users\yoshito\arduino-1.0\libraries\Tone\Tone.cpp: In member function 'void Tone::stop()':
C:\Users\yoshito\arduino-1.0\libraries\Tone\Tone.cpp:361: error: 'digitalWrite' was not declared in this scope
I'm pretty new to the entire coding thing, so could anybody help out with suggestions? Very much obliged!
Not in an unmodified version of the IDE, it isn't. wiring.h was renamed to wiring_private.h, because code is not supposed to directly include wiring.h.
actually i am trying to use this great library to generate some dtmf tones. But in fact i cannot get it working on newer 1.02 (or 1.00) IDE, only on the older 0023
Can You please advise me how to do? What does modified IDE mean, can i download this or are there any detailed instructions how to do this myselves?
Is there any newer or better library to generate dtmf on 1.02 Arduino?
// DTMF (Dual Tone Multiple Frequency) Demonstration // Dual-tone multi-frequency signaling - Wikipedia // To mix the output of the signals to output to a small speaker (i.e. 8 Ohms or higher), // simply use 1K Ohm resistors from each output pin and tie them together at the speaker. // Don't forget to connect the other side of the speaker to ground! #include <Tone.h> Tone freq1; Tone freq2; const int DTMF_freq1[] = { 1336, 1209, 1336, 1477, 1209, 1336, 1477, 1209, 1336, 1477 }; const int DTMF_freq2[] = { 941, 697, 697, 697, 770, 770, 770, 852, 852, 852 }; void setup() { ** Serial.begin(9600);** ** freq1.begin(11);** ** freq2.begin(12);** } void playDTMF(uint8_t number, long duration) { ** freq1.play(DTMF_freq1[number], duration); freq2.play(DTMF_freq2[number], duration); _} void loop() { int i;_ uint8_t phone_number[] = { 8, 6, 7, 5, 3, 0 ,9 }; for(i = 0; i < sizeof(phone_number); i ++) _ {** Serial.print(phone_number*, 10); __ Serial.print(' ');__ playDTMF(phone_number, 500);* * delay(600); }*_
* Serial.println();* * delay(4000);* }[/b][/b] ... and i will get the following error messages: C:\Dokumente und Einstellungen\user\Desktop\arduino-1.0.2\libraries\Tone\Tone.cpp: In member function 'void Tone::begin(uint8_t)': C:\Dokumente und Einstellungen\user\Desktop\arduino-1.0.2\libraries\Tone\Tone.cpp:121: error: 'bitWrite' was not declared in this scope C:\Dokumente und Einstellungen\user\Desktop\arduino-1.0.2\libraries\Tone\Tone.cpp:123: error: 'digitalPinToPort' was not declared in this scope C:\Dokumente und Einstellungen\user\Desktop\arduino-1.0.2\libraries\Tone\Tone.cpp:123: error: 'portOutputRegister' was not declared in this scope C:\Dokumente und Einstellungen\user\Desktop\arduino-1.0.2\libraries\Tone\Tone.cpp:124: error: 'digitalPinToBitMask' was not declared in this scope C:\Dokumente und Einstellungen\user\Desktop\arduino-1.0.2\libraries\Tone\Tone.cpp: In member function 'void Tone::play(uint16_t, uint32_t)': C:\Dokumente und Einstellungen\user\Desktop\arduino-1.0.2\libraries\Tone\Tone.cpp:198: error: 'OUTPUT' was not declared in this scope C:\Dokumente und Einstellungen\user\Desktop\arduino-1.0.2\libraries\Tone\Tone.cpp:198: error: 'pinMode' was not declared in this scope C:\Dokumente und Einstellungen\user\Desktop\arduino-1.0.2\libraries\Tone\Tone.cpp:294: error: 'bitWrite' was not declared in this scope C:\Dokumente und Einstellungen\user\Desktop\arduino-1.0.2\libraries\Tone\Tone.cpp: In member function 'void Tone::stop()': C:\Dokumente und Einstellungen\user\Desktop\arduino-1.0.2\libraries\Tone\Tone.cpp:361: error: 'digitalWrite' was not declared in this scope My problem is that i am arduino beginner andhfor me it is still very difficult to find the right help for this problem ...
Apparently, you didn't read about how to install libraries. The Arduino core library folder is NOT where user downloaded libraries go.
One of the decisions that the Arduino team made was that if the preprocessor can not find a library, for 1.0.1 or later, that is OK. Bullshit. It is not.
Compiling on 1.0.0:
C:\Users\pjs9486\Documents\Arduino\libraries\Tone\Tone.cpp:26:20: error: wiring.h: No such file or directory
C:\Users\pjs9486\Documents\Arduino\libraries\Tone\Tone.cpp: In member function 'void Tone::begin(uint8_t)':
C:\Users\pjs9486\Documents\Arduino\libraries\Tone\Tone.cpp:121: error: 'bitWrite' was not declared in this scope
C:\Users\pjs9486\Documents\Arduino\libraries\Tone\Tone.cpp:123: error: 'digitalPinToPort' was not declared in this scope
C:\Users\pjs9486\Documents\Arduino\libraries\Tone\Tone.cpp:123: error: 'portOutputRegister' was not declared in this scope
C:\Users\pjs9486\Documents\Arduino\libraries\Tone\Tone.cpp:124: error: 'digitalPinToBitMask' was not declared in this scope
C:\Users\pjs9486\Documents\Arduino\libraries\Tone\Tone.cpp: In member function 'void Tone::play(uint16_t, uint32_t)':
C:\Users\pjs9486\Documents\Arduino\libraries\Tone\Tone.cpp:198: error: 'OUTPUT' was not declared in this scope
C:\Users\pjs9486\Documents\Arduino\libraries\Tone\Tone.cpp:198: error: 'pinMode' was not declared in this scope
C:\Users\pjs9486\Documents\Arduino\libraries\Tone\Tone.cpp:294: error: 'bitWrite' was not declared in this scope
C:\Users\pjs9486\Documents\Arduino\libraries\Tone\Tone.cpp: In member function 'void Tone::stop()':
C:\Users\pjs9486\Documents\Arduino\libraries\Tone\Tone.cpp:361: error: 'digitalWrite' was not declared in this scope
Now, a quick search for the first error message says to change wiring.h to Arduino.h, since the library is NOT being used on a wiring board.
Strangely enough, doing that results in a new set of error messages. Resolving these is left for you to do:
Binary sketch size: 4606 bytes (of a 30720 byte maximum)
Tone.cpp does not use WProgram.h. It uses wiring.h (and pins_arduino.h, that it shouldn't). It is wiring.h that needs to be changed to Arduino.h (and the include of pins_arduino.h deleted).
i'm using the Tone library with Arduino v1.03. i modifiy the .cpp & the exemple run correctly but ...
i' trying to use in my program & i have this compilation errors :
have some idea ?
thanks a lot
Patrick
the compilation error :
core.a(Tone.cpp.o): In function __vector_7': D:\App\arduino-1.0.3\hardware\arduino\cores\arduino/Tone.cpp:535: multiple definition of __vector_7'
Tone\Tone.cpp.o:D:\App\arduino-1.0.3\libraries\Tone/Tone.cpp:439: first defined here
core.a(Tone.cpp.o): In function disableTimer(unsigned char)': D:\App\arduino-1.0.3\hardware\arduino\cores\arduino/Tone.cpp:426: multiple definition of timer2_toggle_count'
Tone\Tone.cpp.o:D:\App\arduino-1.0.3\libraries\Tone/Tone.cpp:102: first defined here
core.a(Tone.cpp.o): In function disableTimer(unsigned char)': D:\App\arduino-1.0.3\hardware\arduino\cores\arduino/Tone.cpp:426: multiple definition of timer2_pin_port'
Tone\Tone.cpp.o:D:\App\arduino-1.0.3\libraries\Tone/Tone.cpp:102: first defined here
core.a(Tone.cpp.o): In function disableTimer(unsigned char)': D:\App\arduino-1.0.3\hardware\arduino\cores\arduino/Tone.cpp:426: multiple definition of timer2_pin_mask'
Tone\Tone.cpp.o:D:\App\arduino-1.0.3\libraries\Tone/Tone.cpp:102: first defined here
core.a(Tone.cpp.o): In function disableTimer(unsigned char)': D:\App\arduino-1.0.3\hardware\arduino\cores\arduino/Tone.cpp:426: multiple definition of timer0_pin_port'
Tone\Tone.cpp.o:D:\App\arduino-1.0.3\libraries\Tone/Tone.cpp:102: first defined here
core.a(Tone.cpp.o): In function disableTimer(unsigned char)': D:\App\arduino-1.0.3\hardware\arduino\cores\arduino/Tone.cpp:426: multiple definition of timer0_pin_mask'
Tone\Tone.cpp.o:D:\App\arduino-1.0.3\libraries\Tone/Tone.cpp:102: first defined here
core.a(Tone.cpp.o): In function disableTimer(unsigned char)': D:\App\arduino-1.0.3\hardware\arduino\cores\arduino/Tone.cpp:426: multiple definition of timer1_pin_port'
Tone\Tone.cpp.o:D:\App\arduino-1.0.3\libraries\Tone/Tone.cpp:102: first defined here
core.a(Tone.cpp.o): In function disableTimer(unsigned char)': D:\App\arduino-1.0.3\hardware\arduino\cores\arduino/Tone.cpp:426: multiple definition of timer1_pin_mask'
Tone\Tone.cpp.o:D:\App\arduino-1.0.3\libraries\Tone/Tone.cpp:102: first defined here
core.a(Tone.cpp.o): In function disableTimer(unsigned char)': D:\App\arduino-1.0.3\hardware\arduino\cores\arduino/Tone.cpp:426: multiple definition of timer0_toggle_count'
Tone\Tone.cpp.o:D:\App\arduino-1.0.3\libraries\Tone/Tone.cpp:102: first defined here
core.a(Tone.cpp.o): In function disableTimer(unsigned char)': D:\App\arduino-1.0.3\hardware\arduino\cores\arduino/Tone.cpp:426: multiple definition of timer1_toggle_count'
Tone\Tone.cpp.o:D:\App\arduino-1.0.3\libraries\Tone/Tone.cpp:102: first defined here
Using most recent version Arduino-Library-Tone.zip (md5: BFA2C0FE4830AFBB999417B241807A52)
Arduino-Library-Tone.zip Arduino Tone Library - V0006 Featured
Open "Tone.cpp" in libraries folder and change:
//Comment this OUT begin*
// #include <avr/interrupt.h>
// #include <avr/pgmspace.h>
// #include <wiring.h>
// #include <pins_arduino.h>
// #include "Tone.h"
//Comment this OUT end*
// Add this to Tone.cpp begin #include <avr/interrupt.h> #include <avr/pgmspace.h>
//For Arduino 1.0 #if ARDUINO >= 100 #include <Arduino.h> #else #include <WProgram.h> #endif #include <pins_arduino.h> #include "Tone.h"
// Add this to Tone.cpp end