Help with EMIC2.h

Status
Not open for further replies.
Trying to get this EMIC2 example from the library I found here to compile for the Teensy 3.6 but I`m getting the error message "Mulptiple libraries were found for 'SD.h'". It then lists the paths to two instances of SD.h, one in Arduino/hardware/teensy and one in Arduino/libraries. The path to the teensy folder is listed as USED, while the Arduino/libraries instance is listed as NOT USED. I tried renaming/removing the allegedly unused SD.h but in addition to the multiple instances of the library, it's complaining about 'vol' 'SdVolume' in .../hardware/teensy/...SdFile.cpp not being declared in scope and a bunch of members of SdFile not existing.

Code:
// This example exposes some of the functionality of the EMIC2 library

#include <SD.h>  // Needed by the EMIC2 library, though not utilized in this example
#include "EMIC2.h"

EMIC2 emic;  // Creates an instance of the EMIC2 library

void setup()
{
    // Initializes the EMIC2 instance
    // The library sets up a SoftwareSerial port
    // for the communication with the Emic 2 module
    emic.begin(Serial3);
    
    emic.setVoice(8);  // Sets the voice (9 choices: 0 - 8)
}

void loop()
{
    // The speak method sends a message to the module
    // and then returns while the message plays on the module
    emic.speak("Welcome to the /\\/\\__EMIC2\\/\\/ library. This is an Arduino library \
                that simplifies the use of the __Emic __2 __Text __to __Speech __Module");
    emic.speak(":-)1 Let's now look at some ##pause of the features that the library offers");
    delay(2500);
    ~emic;  // Pauses playback
    delay(500);
    ~emic;  // Unpauses playback when paused
    
    // Sets the speaking rate to 100words/minute (range: [75,600])
    // and then resets it to 200words/minute
    emic.setRate(100);
    emic.speak("You can set and reset the speaking rate");
    emic.resetRate();
    
    // Increases the speaking rate by 150words/minute
    // and then decreases it by 150words/minute
    emic >> 150;
    emic.speak("You can change the speaking rate by the use of operators");
    emic << 150;
    
    // Sets the volume level to 15dB (range: [-48,18])
    // and then resets it to 0dB
    emic.setVolume(10);
    emic.speak("You can set and reset the volume level");
    emic.resetVolume();
    
    // Lowers the volume level by 10dB
    // and then raises it by 10dB
    emic -= 9;
    --emic;
    emic.speak("You can change the volume level by the use of operators");
    emic += 9;
    ++emic;
    
    emic.speak("You can provide any kind of data");
    emic.speak("Even doubles");
    emic.speak(3.14);  // It accepts various alphanumeric or numeric data types
    
    emic.speak(":-)0 Let's now sing a song");
    emic.speakDemo(1);
    delay(2000);
    !emic;  // Stops playback
    
    emic.speak("/\\/\\__DON'T EVEN THINK ABOUT IT");
    // Some of the texts above make use of special control symbols for dynamic changes of
    // pitch (/\ - increase, \/ - decrease), rate (>> - increase, << - decrease),
    // emphasis (__ - emphasize next word), whispering (## - whisper next word),
    // and voice (:-)x, x:[0,8])
    
    while (true) ;
}

Error Message:

Code:
Arduino: 1.8.1 (Windows 7), TD: 1.35, Board: "Teensy 3.6, Serial, 180 MHz, Fast, US English"

SpeakMessage: In function 'void loop()':
SpeakMessage:23: warning: deprecated conversion from string constant to 'char*' 
                 that simplifies the use of the __Emic __2 __Text __to __Speech __Module");

                                                                                         ^

SpeakMessage:24: warning: deprecated conversion from string constant to 'char*' 
     emic.speak(":-)1 Let's now look at some ##pause of the features that the library offers");

                                                                                             ^

SpeakMessage:33: warning: deprecated conversion from string constant to 'char*' 
     emic.speak("You can set and reset the speaking rate");

                                                         ^

SpeakMessage:39: warning: deprecated conversion from string constant to 'char*' 
     emic.speak("You can change the speaking rate by the use of operators");

                                                                          ^

SpeakMessage:45: warning: deprecated conversion from string constant to 'char*' 
     emic.speak("You can set and reset the volume level");

                                                        ^

SpeakMessage:52: warning: deprecated conversion from string constant to 'char*' 
     emic.speak("You can change the volume level by the use of operators");

                                                                         ^

SpeakMessage:56: warning: deprecated conversion from string constant to 'char*' 
     emic.speak("You can provide any kind of data");

                                                  ^

SpeakMessage:57: warning: deprecated conversion from string constant to 'char*' 
     emic.speak("Even doubles");

                              ^

SpeakMessage:60: warning: deprecated conversion from string constant to 'char*' 
     emic.speak(":-)0 Let's now sing a song");

                                            ^

SpeakMessage:65: warning: deprecated conversion from string constant to 'char*' 
     emic.speak("/\\/\\__DON'T EVEN THINK ABOUT IT");

                                                   ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:25:57: error: 'void (* SdFile::dateTime_)(uint16_t*, uint16_t*)' is not a static member of 'class SdFile'

 void (*SdFile::dateTime_)(uint16_t* date, uint16_t* time) = NULL;

                                                         ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:33:28: error: no 'uint8_t SdFile::addCluster()' member function declared in class 'SdFile'

 uint8_t SdFile::addCluster() {

                            ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:46:35: error: no 'uint8_t SdFile::addDirCluster()' member function declared in class 'SdFile'

 uint8_t SdFile::addDirCluster(void) {

                                   ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:61:44: error: no 'dir_t* SdFile::cacheDirEntry(uint8_t)' member function declared in class 'SdFile'

 dir_t* SdFile::cacheDirEntry(uint8_t action) {

                                            ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:74:27: error: no 'uint8_t SdFile::close()' member function declared in class 'SdFile'

 uint8_t SdFile::close(void) {

                           ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:91:71: error: no 'uint8_t SdFile::contiguousRange(uint32_t*, uint32_t*)' member function declared in class 'SdFile'

 uint8_t SdFile::contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock) {

                                                                       ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:130:44: error: no 'uint8_t SdFile::createContiguous(SdFile*, const char*, uint32_t)' member function declared in class 'SdFile'

         const char* fileName, uint32_t size) {

                                            ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:158:36: error: no 'uint8_t SdFile::dirEntry(dir_t*)' member function declared in class 'SdFile'

 uint8_t SdFile::dirEntry(dir_t* dir) {

                                    ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:178:50: error: no 'void SdFile::dirName(const dir_t&, char*)' member function declared in class 'SdFile'

 void SdFile::dirName(const dir_t& dir, char* name) {

                                                  ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:201:46: error: no 'void SdFile::ls(uint8_t, uint8_t)' member function declared in class 'SdFile'

 void SdFile::ls(uint8_t flags, uint8_t indent) {

                                              ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:245:58: error: no 'uint8_t SdFile::make83Name(const char*, uint8_t*)' member function declared in class 'SdFile'

 uint8_t SdFile::make83Name(const char* str, uint8_t* name) {

                                                          ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:284:57: error: no 'uint8_t SdFile::makeDir(SdFile*, const char*)' member function declared in class 'SdFile'

 uint8_t SdFile::makeDir(SdFile* dir, const char* dirName) {

                                                         ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:384:74: error: no 'uint8_t SdFile::open(SdFile*, const char*, uint8_t)' member function declared in class 'SdFile'

 uint8_t SdFile::open(SdFile* dirFile, const char* fileName, uint8_t oflag) {

                                                                          ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:476:68: error: no 'uint8_t SdFile::open(SdFile*, uint16_t, uint8_t)' member function declared in class 'SdFile'

 uint8_t SdFile::open(SdFile* dirFile, uint16_t index, uint8_t oflag) {

                                                                    ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:502:64: error: no 'uint8_t SdFile::openCachedEntry(uint8_t, uint8_t)' member function declared in class 'SdFile'

 uint8_t SdFile::openCachedEntry(uint8_t dirIndex, uint8_t oflag) {

                                                                ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:550:26: error: 'uint8_t SdFile::openRoot' is not a static member of 'class SdFile'

 uint8_t SdFile::openRoot(SdVolume* vol) {

                          ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:550:26: error: 'SdVolume' was not declared in this scope

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:550:36: error: 'vol' was not declared in this scope

 uint8_t SdFile::openRoot(SdVolume* vol) {

                                    ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:550:41: error: expected ',' or ';' before '{' token

 uint8_t SdFile::openRoot(SdVolume* vol) {

                                         ^

Multiple libraries were found for "SD.h"
 Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD
 Not used: C:\Program Files (x86)\Arduino\libraries\SD
Error compiling for board Teensy 3.6.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Any advice?
 
Trying to get this EMIC2 example from the library I found here

I see at least 2 different copies on that thread, in messages #14 and #16. One ZIP file is 71401 bytes size, the other is 67215 bytes.

Can you be more specific which ones you're really using? If I try to look into this, wouldn't it be best if I don't need to guess which ones to try?
 
Sorry to butt in but I believe she is using the zip attached to message 14. That's the lib without sdfat-beta. The one that should be used is the one on #16.
 
Ok. Looks like you are using the first example, SpeakMessage.ino. Just download and install the SDFAT-beta library and then change the include to make it SDFAT.h instead of SD.h. I am not sure how to get rid of the warnings, it still works with them.
 
Status
Not open for further replies.
Back
Top