Pages: [1]   Go Down
Author Topic: (ERRORE) EasyVr_AccessControlDemo  (Read 1223 times)
0 Members and 1 Guest are viewing this topic.
Firenze (Italy)
Offline Offline
Full Member
***
Karma: 0
Posts: 229
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Salve

PREMETTO CHE la scheda EasyVR in questione  si collega regolarmente, ci posso inserire nuovi comandi e riconoscimento vocale, salvando, etc etc, e tutto funziona.

Purtroppo ricevo un errore quando carico un prg Demo fornito (EasyVr_AccessControlDemo) per la scheda EasyVR (riconoscimento vocale), sia con la Ver. 0023 che con la Ver. 1.0 di ARDUINO.
(Nel CODICE ho evidenziato in GRASSETTO BLU la riga dove trova l'errore)

Gli errori sono rispettivamente:

VERSIONE 0023

EasyVR_AccessControlDemo:57: error: no matching function for call to 'EasyVR::EasyVR(NewSoftSerial&)'
F:\- ARDUINO\arduino-0023\libraries\EasyVR/EasyVR.h:185: note: candidates are: EasyVR::EasyVR(Stream&)
F:\- ARDUINO\arduino-0023\libraries\EasyVR/EasyVR.h:33: note:                 EasyVR::EasyVR(const EasyVR&)


VERSIONE 1.0
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:39:24: error: WConstants.h: No such file or directory
In file included from F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:41:
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\/NewSoftSerial.h:71: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)'
F:\- ARDUINO\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp: In member function 'void NewSoftSerial::tx_pin_write(uint8_t)':
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:291: error: 'LOW' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp: In member function 'void NewSoftSerial::setTX(uint8_t)':
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:368: error: 'OUTPUT' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:368: error: 'pinMode' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:369: error: 'HIGH' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:369: error: 'digitalWrite' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:370: error: 'digitalPinToBitMask' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:371: error: 'digitalPinToPort' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:372: error: 'portOutputRegister' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp: In member function 'void NewSoftSerial::setRX(uint8_t)':
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:377: error: 'INPUT' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:377: error: 'pinMode' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:379: error: 'HIGH' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:379: error: 'digitalWrite' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:381: error: 'digitalPinToBitMask' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:382: error: 'digitalPinToPort' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:383: error: 'portInputRegister' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp: In member function 'virtual void NewSoftSerial::write(uint8_t)':
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:472: error: 'HIGH' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:472: error: 'LOW' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:478: error: 'byte' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:478: error: expected `;' before 'mask'
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:478: error: 'mask' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:492: error: 'byte' was not declared in this scope
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:492: error: expected `;' before 'mask'
F:\- ARDUINO\arduino-1.0\libraries\NewSoftSerial\NewSoftSerial.cpp:492: error: 'mask' was not declared in this scope



CODICE

.... omissis ....

#if defined(ARDUINO) && ARDUINO >= 100
  #include "Arduino.h"
  #include "SoftwareSerial.h"
  SoftwareSerial port(12,13);
#else // Arduino 0022 - use modified NewSoftSerial
  #include "WProgram.h"
  #include "NewSoftSerial.h"
  NewSoftSerial port(12,13);
#endif

#include "EasyVR.h"
#include <Servo.h>

#define SND_Access_denied            1
#define SND_Access_granted           2
#define SND_Hello                    3
#define SND_Please_repeat            4
#define SND_Please_say_your_password 5
#define SND_Please_talk_louder       6


Servo myservo;
EasyVR easyvr(port);
EasyVRBridge bridge;

uint32_t mask = 0;
int8_t group = 0;
uint8_t train = 0;
char name[32];

.... omissis ....
Logged

Marche
Offline Offline
Edison Member
*
Karma: 34
Posts: 2276
azioni semplici per risultati complessi
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Io l'ho usato con l'ide 0022 e ha funzionato a dovere.
Logged

Firenze (Italy)
Offline Offline
Full Member
***
Karma: 0
Posts: 229
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Provo a riscaricare l'IDE 0022 e vediamo
Logged

Firenze (Italy)
Offline Offline
Full Member
***
Karma: 0
Posts: 229
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Anche con la 0022 ricevo:

EasyVR_AccessControlCGS64.cpp:1:27: error: NewSoftSerial.h: No such file or directory
EasyVR_AccessControlCGS64:1: error: 'NewSoftSerial' does not name a type
EasyVR_AccessControlCGS64:4: error: 'port' was not declared in this scope
EasyVR_AccessControlCGS64.cpp: In function 'void setup()':
EasyVR_AccessControlCGS64:53: error: 'port' was not declared in this scope


Non capisco !
Logged

Marche
Offline Offline
Edison Member
*
Karma: 34
Posts: 2276
azioni semplici per risultati complessi
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Scusa la domanda, ma hai messo le librerie nell'IDE?
Logged

Firenze (Italy)
Offline Offline
Full Member
***
Karma: 0
Posts: 229
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Si certamente--- ;-)

Comunque ho scoperto l'arcano.

Ho eliminato tutti i files dalla TEMP (sotto C:\Users\Gaetano\Application Data\.............) e tutto FUNZIONA !!!

Cioè, adesso non da' più errore e carica lo Sketch.... pero' ......

con questo codice non accade niente (NON STAMPA neppure nulla sul Serial Monitor dell'IDE !!!

Ci capisci qualcosa ?



#include <NewSoftSerial.h>
NewSoftSerial port(12,13);

#include <EasyVR.h>
EasyVR easyvr(port);

//Groups and Commands
enum Groups
{
  GROUP_0  = 0,
  GROUP_1  = 1,
  GROUP_16 = 16,
};

enum Group0
{
  G0_JAMES = 0,
};

enum Group1
{
  G1_GAETANO = 0,
  G1_DANIEL = 1,
  G1_ROSSO = 2,
  G1_VERDE = 3,
  G1_GIALLO = 4,
  G1_APRI = 5,
  G1_CHIUDI = 6,
  G1_CHIUDIPORTA = 7,
  G1_APRIPORTA = 8,
  G1_LUCEGIARDINO = 9,
};

enum Group16
{
  G16_MRJONES = 0,
};

EasyVRBridge bridge;
int8_t group, idx;
void setup()
{
  Serial.begin(9600);
  port.begin(9600);
  Serial.println("STAMPIAMO");
  
  // bridge mode?
  if (bridge.check())
  {
    cli();
    bridge.loop(0, 1, 12, 13);
  }
  // run normally
  //Serial.begin(9600);
  //port.begin(9600);
  //Serial.println("STAMPIAMO");

  if (!easyvr.detect())
  {
    Serial.println("EasyVR not detected!");
    for (;;);
  }

  easyvr.setPinOutput(EasyVR::IO1, LOW);
  Serial.println("EasyVR detected!");
  easyvr.setTimeout(5);
  easyvr.setLanguage(1);

  group = EasyVR::TRIGGER; //<-- start group (customize)
}

void action();

void loop()
{
  easyvr.setPinOutput(EasyVR::IO1, HIGH); // LED on (listening)

  Serial.print("Say a command in Group ");
  Serial.println(group);
  easyvr.recognizeCommand(group);

  do
  {
    // can do some processing while waiting for a spoken command
  }
  while (!easyvr.hasFinished());
  
  easyvr.setPinOutput(EasyVR::IO1, LOW); // LED off

  idx = easyvr.getWord();
  if (idx >= 0)
  {
   // built-in trigger (ROBOT)
   // group = GROUP_X; <-- jump to another group X
   return;
  }
  idx = easyvr.getCommand();
  if (idx >= 0)
  {
    // print debug message
    uint8_t train = 0;
    char name[32];
    Serial.print("Command: ");
    Serial.print(idx);
    if (easyvr.dumpCommand(group, idx, name, train))
    {
      Serial.print(" = ");
      Serial.println(name);
    }
    else
      Serial.println();
    easyvr.playSound(0, EasyVR::VOL_FULL);
    // perform some action
    action();
  }
  else // errors or timeout
  {
    if (easyvr.isTimeout())
      Serial.println("Timed out, try again...");
    int16_t err = easyvr.getError();
    if (err >= 0)
    {
      Serial.print("Error ");
      Serial.println(err, HEX);
    }
  }
}

void action()
{
    switch (group)
    {
    case GROUP_0:
      switch (idx)
      {
      case G0_JAMES:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      }
      break;
    case GROUP_1:
      switch (idx)
      {
      case G1_GAETANO:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_DANIEL:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_ROSSO:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_VERDE:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_GIALLO:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_APRI:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_CHIUDI:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_CHIUDIPORTA:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_APRIPORTA:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_LUCEGIARDINO:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      }
      break;
    case GROUP_16:
      switch (idx)
      {
      case G16_MRJONES:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      }
      break;
    }
}
« Last Edit: January 01, 2012, 04:42:46 pm by cgs64 » Logged

Marche
Offline Offline
Edison Member
*
Karma: 34
Posts: 2276
azioni semplici per risultati complessi
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Perfetto, ora divertiti con quel modulino ma mi raccomando non usarlo per applicazioni critiche tipo aprire il portone di casa o cose simili.... da quello che ricordo è piuttosto "ingenuo", prova a storpiare le parole chiave e noterai con rammarico che da quasi tutto per buono.
Logged

Firenze (Italy)
Offline Offline
Full Member
***
Karma: 0
Posts: 229
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

TRANQUI !

Lo uso per comandare un po' di cose ma "in casa".

Ho scoperto che con "#include <NewSoftSerial.h>"......
tutti i comandi che usano la seriale alla "vecchia maniera" non sono cagati affatto, ad esempio....
  Serial.begin(9600);
  port.begin(9600);
  Serial.println("STAMPIAMO");

Hai una vaga idea se si possa stampare (inviare dati) al Serial Monitor in altro modo ?
Logged

Marche
Offline Offline
Edison Member
*
Karma: 34
Posts: 2276
azioni semplici per risultati complessi
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Non ho più il modulo per fare delle prove però mi pare di ricordare che il modulo usa i pin 0 e 1 di arduino per comunicare, ecco perchè non ti funziona il serial monitor dell'IDE
Logged

Firenze (Italy)
Offline Offline
Full Member
***
Karma: 0
Posts: 229
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

per INFO GENERALE

il problema nasce da fatto che se si usa una IDE > alla 0022 tutto funziona abbastanza MALE !

Usando la 0022 tutto OK
Logged

Pages: [1]   Go Up
Jump to: