Go Down

Topic: 'PlayFile' was not declared in this scope (Read 2375 times) previous topic - next topic

CyPRyS

Oct 31, 2016, 02:53 pm Last Edit: Nov 02, 2016, 02:40 pm by CyPRyS
hello, i have problem compiling with this error 'PlayFile' was not declared in this scope

My program is this

//  File MusicPlayWithName.ino
//  Demo code for playing any existing music file on Micro SD card by file name
//  For more details about the product please check http://www.seeedstudio.com/depot/

//  Copyright (c) 2010 seeed technology inc.
//  Author: Icing Chang
//  Version: 1.0
//  Time: Oct 21, 2010
//  Changing records:
//   
//  This library is free software; you can redistribute it and/or
//  modify it under the terms of the GNU Lesser General Public
//  License as published by the Free Software Foundation; either
//  version 2.1 of the License, or (at your option) any later version.
//
//  This library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with this library; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

/**************************Note*******************************************
 To make this demo code run sucessfully, you need to download the fat16lib
 into your Arduino library at the following address:
http://code.google.com/p/fat16lib/downloads/detail?name=fat16lib20101009.zip&can=2&q=
**************************************************************************/

#include <Arduino.h>
#include <avr/io.h>
#include "config.h"
#include "player.h"
#include "vs10xx.h"

#include <Fat16.h>
#include <Fat16Util.h>
#include "newSDLib.h"

void setup()
{
  Serial.begin(9600);

  InitSPI();

  InitIOForVs10xx();

  InitIOForKeys();

  InitIOForLEDs();

  Mp3Reset();
  if (!initialSDCard())
    return;

  RED_LED_ON();//light red LED
}


void loop()
{
  playFile("1.mp3"); //play the song with the name you give.
//playFile("test.wma");
//playFile("test.wav");
}



Grumpy_Mike

#1
Nov 01, 2016, 12:22 am Last Edit: Nov 01, 2016, 12:23 am by Grumpy_Mike
This means you haven't installed the library. One of the ones in that list of #include statements that are in quote marks "name".

CyPRyS

Yes, it might be, but which one is missing.

Arduino:1.6.12 (Windows 7), Płytka:"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Program Files (x86)\Arduino\libraries\MusicShieldNewSDLib\examples\MusicPlayRandomly\MusicPlayRandomly.ino: In function 'void loop()':

MusicPlayRandomly:65: error: 'playFile' was not declared in this scope

   while(1)playFile();    //shuffle your music you find in the root directory of SD card.

                    ^

In file included from C:\Program Files (x86)\Arduino\libraries\MusicShieldNewSDLib\examples\MusicPlayRandomly\MusicPlayRandomly.ino:38:0:

C:\Users\Michał\Documents\Arduino\libraries\Fat16/Fat16Util.h: At global scope:

C:\Users\Michał\Documents\Arduino\libraries\Fat16/Fat16Util.h:36:12: warning: 'int FreeRam()' defined but not used [-Wunused-function]

 static int FreeRam(void) {

            ^

C:\Users\Michał\Documents\Arduino\libraries\Fat16/Fat16Util.h:66:22: warning: 'void SerialPrintln_P(const char*)' defined but not used [-Wunused-function]

 static NOINLINE void SerialPrintln_P(PGM_P str) {

                      ^

Znaleziono wiele bibliotek w "config.h"
Wykorzystane: C:\Users\Michał\Documents\Arduino\libraries\music_v1_2
Niewykorzystane: C:\Users\Michał\Documents\Arduino\libraries\MusicShieldNewSDLib
Niewykorzystane: C:\Program Files (x86)\Arduino\libraries\music_v1_2
Niewykorzystane: C:\Program Files (x86)\Arduino\libraries\MusicShieldNewSDLib
Niewykorzystane: C:\Users\Michał\Documents\Arduino\libraries\MusicShieldNewSDLib
Niewykorzystane: C:\Program Files (x86)\Arduino\libraries\music_v1_2
Niewykorzystane: C:\Program Files (x86)\Arduino\libraries\MusicShieldNewSDLib
Niewykorzystane: C:\Users\Michał\Documents\Arduino\libraries\MusicShieldNewSDLib
Niewykorzystane: C:\Program Files (x86)\Arduino\libraries\music_v1_2
Niewykorzystane: C:\Program Files (x86)\Arduino\libraries\MusicShieldNewSDLib
Niewykorzystane: C:\Users\Michał\Documents\Arduino\libraries\MusicShieldNewSDLib
Niewykorzystane: C:\Program Files (x86)\Arduino\libraries\music_v1_2
Niewykorzystane: C:\Program Files (x86)\Arduino\libraries\MusicShieldNewSDLib
Znaleziono wiele bibliotek w "Fat16.h"
Wykorzystane: C:\Users\Michał\Documents\Arduino\libraries\Fat16
Niewykorzystane: C:\Program Files (x86)\Arduino\libraries\mp3
Niewykorzystane: C:\Program Files (x86)\Arduino\libraries\Robot_Control
Niewykorzystane: C:\Program Files (x86)\Arduino\libraries\Fat16
Znaleziono wiele bibliotek w "newSDLib.h"
Wykorzystane: C:\Users\Michał\Documents\Arduino\libraries\MusicShieldNewSDLib
Niewykorzystane: C:\Program Files (x86)\Arduino\libraries\MusicShieldNewSDLib
Niewykorzystane: C:\Program Files (x86)\Arduino\libraries\MusicShieldNewSDLib
Niewykorzystane: C:\Program Files (x86)\Arduino\libraries\MusicShieldNewSDLib
Niewykorzystane: C:\Program Files (x86)\Arduino\libraries\MusicShieldNewSDLib
exit status 1
'playFile' was not declared in this scope

Ten raport powinien zawierać więcej informacji jeśli w
File -> Preferencje zostanie włączona opcja "Pokaż
szczegółowe informacje podczas kompilacji"

Grumpy_Mike

It could be "player.h" but as you have not posted any links to none standard libraries like it says here How to use this forum I can't verify.
Please supply links of all libiary files inside the quote marks.

Also the #include "vs10xx.h" looks a bit odd because xx normal means a wild card and maybe you are suposed to change this to the actual file you downloaded.

CyPRyS

im trying to run this

http://www.elecfreaks.com/wiki/index.php?title=Freaduino_MP3_Music_Shield

for that i have all necesery libraries installed to arduino

Grumpy_Mike

Quote
for that i have all necesery libraries installed to arduino
No you don't or you would not get that error message.

Quote
im trying to run this

http://www.elecfreaks.com/wiki/index.php?title=Freaduino_MP3_Music_Shield
That page has more than one set of software. Please try and cooperate, and answer the questions in reply #3.

CyPRyS

Programming
Software Installation For Arduino 1.0.1
Play All music:
1. Make sure there are songs in the micro sd card.
2. Download File:Music v1_2.zip for music shield.
3. Uncompress these two packages and put them in Arduino-1.0.1 program: ..\Arduino-1.0.1\libraries
4. [Ignore this if under Linux] Download a new portpins.h file and replace the default portpins.h file of Arduino-1.0.1 program: ..\arduino-1.0.1\hardware\tools\avr\avr\include\avr
5. Select the corresponding Arduino board, like Arduino UNO or Duemilanove or others.
6. Run the arduino program compile and upload the sketch of music_v1_2 -> music into Arduino board.
7. If you need the IIC LCD display, please use our IIC/SPI LCD module and a 4pin wires connect with each other, and Import the library.
Just enjoy.

1. i have sd card my song is 1.mp3 without dir just on the card
2. i have added zip library  File:Music v1_2.zip
3. portpins.h file and replace the default portpins.h - i have done that
4. Select the corresponding Arduino board, like Arduino UNO or Duemilanove or others. - i have selected mega
5. If you need the IIC LCD display, please use our IIC/SPI LCD module and a 4pin wires connect with each other, and Import the library.
Just enjoy.  - i do not have this have no LCD mounted

Grumpy_Mike

Quote
6. Run the arduino program compile and upload the sketch of music_v1_2 -> music into Arduino board.
There is no sketch music_v1_2 -> music.

Where did you get the code that you posted at the start of the post.

I am not very impressed by your behavior here, I am trying to help and it seems to me that you are just jerking me about.

CyPRyS

I canot compile so there will be no sketch to put to the board
after running arduino programe compile there is a  'PlayFile' was not declared in this scope
command.

CyPRyS

#9
Nov 02, 2016, 02:45 pm Last Edit: Nov 02, 2016, 02:53 pm by CyPRyS
There is no sketch music_v1_2 -> music.

Where did you get the code that you posted at the start of the post.

I am not very impressed by your behavior here, I am trying to help and it seems to me that you are just jerking me about.
The code is in arduino program under

FILE _> PRZYKLADY (EXAMPLES)- > MusicShieldNewSDLib _> PLAYFILEWITHNAME

My beahaviour is in perfect condition, i am from Poland, i need to think in polish and english and answer in english, it may be difficult but i am trying

MusicShieldNewSDLib will apear when you put MusicShieldNewSDLib.zip in the arduino programe

Grumpy_Mike

Quote
The code is in arduino program under

FILE _> PRZYKLADY (EXAMPLES)- > MusicShieldNewSDLib _> PLAYFILEWITHNAME
Please try and answer my question, where is the code from?

Quote
MusicShieldNewSDLib will apear when you put MusicShieldNewSDLib.zip in the arduino programe
This is the first time you have mentioned this file in this post. How was I supposed to know this? Where is this file to be found?

Quote
My beahaviour is in perfect condition, i am from Poland, i need to think in polish and english and answer in english, it may be difficult but i am trying
Maybe your English skills are not sufficient for you to be posting here. It comes across that I ask you something and you do not answer correctly. So from my point of view you seem to be mocking me.

Go Up