HELLO EVERYONE ,,
I AM NEW TO THIS FORUM AND EVEN NEW TO ARDUINO.
I WAS MAKING A VOICE PROJECT WITH HELP OF ARDUINO BUT WHENEVER I TRY TO ADD A NEW LIBRARIES IN THE LIBRARY FOLDER OF ARDUINO IT ALWAYS SHOWS A ERROR "TMRpcm DOES NOT NAME A TYPE" OR ANY OTHER LIBRARY EXCEPT THIS ONE';;;
I EVEN FOUND SAME KIND OF ERROR WHEN I WAS USING DS1307 LIBRARY. BUT SOME HOW WAS ABLE TO FIX IT AFTER 5MONTHS
AND NOW I AM REALLY FRUSTRATED PLS PLS PLS HELP ME WITH THIS ERROR. =( =(
#include <SD.h>Â Â Â Â Â Â Â Â Â Â Â // need to include the SD library
//#define SD_ChipSelectPin 53Â //example uses hardware SS pin 53 on Mega2560
#define SD_ChipSelectPin 10Â //using digital pin 4 on arduino nano 328
#include <TMRpcm.h>Â Â Â Â Â //Â also need to include this library...
TMRpcm tmrpcm;Â // create an object for use in this sketch
char mychar;
void setup(){
 tmrpcm.speakerPin = 9; //11 on Mega, 9 on Uno, Nano, etc
 Serial.begin(9600);
 if (!SD.begin(SD_ChipSelectPin)) { // see if the card is present and can be initialized:
  Serial.println("SD fail");
  return; // don't do anything more if not
 }
 tmrpcm.play("beware.wav"); //the sound file "music" will play each time the arduino powers up, or is reset
}
void loop(){
 if(Serial.available()){Â
  mychar = Serial.read();
 Â
  if(mychar == 'o'){ //send the letter p over the serial monitor to start playback
   tmrpcm.play("helpyou.wav");
  } else if(mychar == 'r'){ //send the letter p over the serial monitor to start playback
   tmrpcm.play("chortle.wav");
  } else if(mychar == 'q'){ //send the letter p over the serial monitor to start playback
   tmrpcm.play("helpyou.wav");
  } else if(mychar == 'p'){
   tmrpcm.play("beware.wav");
  }
  else if(mychar == 'w'){ //send the letter p over the serial monitor to start playback
   tmrpcm.play("impresiv.wav");
  }
  else if(mychar == 't'){ //send the letter p over the serial monitor to start playback
   tmrpcm.play("seekyoda.wav");
  }
  else if(mychar == 'y'){ //send the letter p over the serial monitor to start playback
   tmrpcm.play("sensefear.wav");
  }
  else if(mychar == 'u'){ //send the letter p over the serial monitor to start playback
   tmrpcm.play("strongami.wav");
  }
  else if(mychar == 'i'){ //send the letter p over the serial monitor to start playback
   tmrpcm.play("whyhere.wav");
  }
 }
}
and this is the error i am getting
sketch_jul26a:6: error: 'TMRpcm' does not name a type
sketch_jul26a.ino: In function 'void setup()':
sketch_jul26a:11: error: 'tmrpcm' was not declared in this scope
sketch_jul26a.ino: In function 'void loop()':
sketch_jul26a:29: error: 'tmrpcm' was not declared in this scope
sketch_jul26a:31: error: 'tmrpcm' was not declared in this scope
sketch_jul26a:33: error: 'tmrpcm' was not declared in this scope
sketch_jul26a:35: error: 'tmrpcm' was not declared in this scope
sketch_jul26a:38: error: 'tmrpcm' was not declared in this scope
sketch_jul26a:41: error: 'tmrpcm' was not declared in this scope
sketch_jul26a:44: error: 'tmrpcm' was not declared in this scope
sketch_jul26a:47: error: 'tmrpcm' was not declared in this scope
sketch_jul26a:50: error: 'tmrpcm' was not declared in this scope
and this is the site from where i got the code and even the library
hii everyone,
i found out one more new thing ,,
that is whenever i open my ide and goes to "sketch>importlibrary>TMRpcmmaster"
and clicks on it ,, it show a blank on the sketch ,, but if i add any other library like motor or servo it shows the line as #include<motor.h>.
whereas if i import TMRpcm master library it just shows nothing.
I just went to github, got the library and installed it,
started up Arduino 1.0, copied and pasted your code, set the board to "Uno", hit compile, and got this error message
Binary sketch size: 15660 bytes (of a 32256 byte maximum)
i have arduino uno.
and as nick sir u said it was inside the libraries folder.
but after my frustration on my laptop.
i opened ide and then went to the sketchoption and in that i opened up the import library option.
i imported the library.
bt still i came up with the same error ,,
bt then i again deleted the folder and i imported the same library again with the same above mentioned procedure.
but this time i opened the tmrpcm-master named folder and again inside that there was a folder named tmrpcm.
this time i selected the folder named tmrpcm. and imported the libary.
and it worked.
now i really dont know how it worked,, was it due to the frustration which tapped my laptop for many times or elese it was some kind of my silly mistake.
and thanks a lott everyone for the help.
further again i think i would be having some issues when i start my project.
ill again bother you all ,, nick sir and awol sir.
thanks a lot for ur precious time.
parthbhat13:
this time i opened the tmrpcm-master named folder and again inside that there was a folder named tmrpcm.
this time i selected the folder named tmrpcm. and imported the libary.
The folder named TMRpcm should be directly inside the libraries folder, and not nested inside another folder. This is probably why your initial attempts to import it failed.
Note that the libraries folder Nick referred to is within the folder where you save your sketches, not the folder where the Arduino software is installed.