'EasyVRBridge' does not name a type

Hi
what this library's mistakes, and other code that is out of this error. On how to fix this error.

#include "Arduino.h"
#include "SoftwareSerial.h"
SoftwareSerial port(12,13);
#include "EasyVR.h"
EasyVR easyvr(port);

//Groups and Commands
enum Groups
{
  GROUP_0  = 0,
  GROUP_1  = 1,
  GROUP_3  = 3,
};

enum Group0 
{
  G0_ROBOT= 0,
};

enum Group1 
{
  G1_MOVE = 0,
  G1_TIME = 1,
  G1_DATE = 2,
  G1_LOCATION = 3,
  G1_TEMPERATURE = 4,
  G1_COLOUR = 5,
  G1_HUMIDITY = 6,
  G1_MOTION = 7,
  G1_DISTANCE = 8,
  G1_BEARING = 9,
  G1_POWER = 10,
  G1_AIR = 11,
  G1_DISPLAY = 12,
  G1_QUESTION = 13,
  G1_MANUAL = 14,
  G1_AUTO = 15,
  G1_RUN = 16,
  G1_POWERDOWN = 17,
  G1_WAKEUP = 18,
};

enum Group3 
{
  G3_LEFT = 0,
  G3_RIGHT = 1,
  G3_FORWARD = 2,
  G3_BACKWARD = 3,
  G3_FOLLOW = 4,
  G3_STOP = 5,
  G3_GRAB = 6,
};




EasyVRBridge bridge;

int8_t group, idx;

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

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

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

  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_ROBOT:
        // write your action code here
        digitalWrite(8,HIGH); // LED to tell me if this is working
        Serial.println("IT WORKS");
        group = GROUP_1;
        delay(10);
        digitalWrite(8,LOW);
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      }
      break;
    case GROUP_1:
      switch (idx)
      {
      case G1_MOVE:
        // write your action code here
        digitalWrite(7, HIGH); // LED to tell me if this is working
        delay(1000);
        digitalWrite(7, LOW);
        Serial.println("YES");
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_TIME:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_DATE:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_LOCATION:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_TEMPERATURE:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_COLOUR:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_HUMIDITY:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_MOTION:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_DISTANCE:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_BEARING:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_POWER:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_AIR:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_DISPLAY:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_QUESTION:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_MANUAL:
        // write your action code here
          digitalWrite(6, HIGH); // LED's to tell me this is working
        delay(1000);
        digitalWrite(6, LOW);
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_AUTO:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_RUN:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_POWERDOWN:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_WAKEUP:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      }
      break;
    case GROUP_3:
      switch (idx)
      {
      case G3_LEFT:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G3_RIGHT:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G3_FORWARD:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G3_BACKWARD:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G3_FOLLOW:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G3_STOP:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G3_GRAB:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      }
      break;
    
      break;
    }
}

sketch_jul27b.ino (7.22 KB)

First, we appreciate that you tried to post your source code properly, but you used the quote tags rather than the code tags. Use the '</>' tags.

Second, the error I'm getting is that it cannot find the "EasyVR.h" header file. Since you have them in double quotes, I'm assuming you have the file in the same directory as the source code file. Evidently, it is not there nor is it in the standard libraries directory of the IDE.

econjack:
First, we appreciate that you tried to post your source code properly, but you used the quote tags rather than the code tags. Use the '</>' tags.

All gone now - he attached it instead. :slight_smile:

econjack:
Second, the error I'm getting is that it cannot find the "EasyVR.h" header file. Since you have them in double quotes, I'm assuming you have the file in the same directory as the source code file. Evidently, it is not there nor is it in the standard libraries directory of the IDE.

No, that's not it. The error would have been more like:- "No such file or directory".

@erka, there is no 'EasyVRBridge' in the 'EasyVR' library. It's something that you appear to have invented.
You need to look more closely at the "EasyVRBridge" example that's provided with the library, then start again.
To check for the bridge mode, they do this:-

// bridge mode?
  int mode = easyvr.bridgeRequested(pcSerial);
  switch (mode)
  {
  case EasyVR::BRIDGE_NONE:
    // setup EasyVR serial port
    port.begin(9600);
    // run normally
    pcSerial.println(F("Bridge not started!"));
    pcSerial.println(F("---"));
    break;
    
  case EasyVR::BRIDGE_NORMAL:
    // setup EasyVR serial port (low speed)
    port.begin(9600);
    // soft-connect the two serial ports (PC and EasyVR)
    easyvr.bridgeLoop(pcSerial);
    // resume normally if aborted
    pcSerial.println(F("Bridge connection aborted!"));
    pcSerial.println(F("---"));
    break;
    
  case EasyVR::BRIDGE_BOOT:
    // setup EasyVR serial port (high speed)
    port.begin(115200);
    // soft-connect the two serial ports (PC and EasyVR)
    easyvr.bridgeLoop(pcSerial);
    // resume normally if aborted
    pcSerial.println(F("Bridge connection aborted!"));
    pcSerial.println(F("---"));
    break;
  }

Not this:-

// bridge mode?
  if (bridge.check())
  {
    cli();
    bridge.loop(0, 1, 12, 13);
  }

'EasyVR' doesn't even have a method called 'check()'. Where did you get that from?

Edit: If I'd noticed earlier that you were cross-posting, I wouldn't have bothered to reply at all. Please don't waste peoples' time by doing that.
Voice recognition with easyVR - bridge problem

I'm doing the robot control the voice of using the easyvr. Give it a code you see.

#include "Arduino.h"
#if !defined(SERIAL_PORT_MONITOR)
  #error "Arduino version not supported. Please update your IDE to the latest version."
#endif

#if defined(SERIAL_PORT_USBVIRTUAL)
  // Shield Jumper on HW (for Leonardo and Due)
  #define port SERIAL_PORT_HARDWARE
  #define pcSerial SERIAL_PORT_USBVIRTUAL
#else
  // Shield Jumper on SW (using pins 12/13 or 8/9 as RX/TX)
  #include "SoftwareSerial.h"
  SoftwareSerial port(12, 13);
  #define pcSerial SERIAL_PORT_MONITOR
#endif

#include "EasyVR.h"

EasyVR easyvr(port);

//Groups and Commands
enum Groups
{
  GROUP_1  = 1,
};

enum Group1 
{
  G1_GO = 0,
  G1_LEFT = 1,
  G1_STOP = 2,
  G1_RIGHT = 3,
  G1_BACK = 4,
};


int8_t group, idx;
int motor1 = 6; 
int motor2 = 7; 
int enableA = 5; 
int motor3 = 8; 
int motor4 = 9; 
int enableB = 10;

void setup()
{
    pinMode(motor1, OUTPUT);
    pinMode(motor2, OUTPUT);
    pinMode(enableA, OUTPUT);
    pinMode(motor3, OUTPUT);
    pinMode(motor4, OUTPUT);
    pinMode(enableB, OUTPUT);
    digitalWrite(enableA, HIGH);
    digitalWrite(enableB, HIGH);
  // setup PC serial port
  pcSerial.begin(9600);

  // bridge mode?
  int mode = easyvr.bridgeRequested(pcSerial);
  switch (mode)
  {
  case EasyVR::BRIDGE_NONE:
    // setup EasyVR serial port
    port.begin(9600);
    // run normally
    pcSerial.println(F("---"));
    pcSerial.println(F("Bridge not started!"));
    break;
    
  case EasyVR::BRIDGE_NORMAL:
    // setup EasyVR serial port (low speed)
    port.begin(9600);
    // soft-connect the two serial ports (PC and EasyVR)
    easyvr.bridgeLoop(pcSerial);
    // resume normally if aborted
    pcSerial.println(F("---"));
    pcSerial.println(F("Bridge connection aborted!"));
    break;
    
  case EasyVR::BRIDGE_BOOT:
    // setup EasyVR serial port (high speed)
    port.begin(115200);
    // soft-connect the two serial ports (PC and EasyVR)
    easyvr.bridgeLoop(pcSerial);
    // resume normally if aborted
    pcSerial.println(F("---"));
    pcSerial.println(F("Bridge connection aborted!"));
    break;
  }

  while (!easyvr.detect())
  {
    Serial.println("EasyVR not detected!");
    delay(1000);
  }

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

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

void action();

void loop()
{
  if (easyvr.getID() < EasyVR::EASYVR3)
    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());
  
  if (easyvr.getID() < EasyVR::EASYVR3)
    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();
	// beep
    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_1:
      switch (idx)
      {
      case G1_GO:
        // write your action code here
        digitalWrite(motor1,HIGH);
        digitalWrite(motor2,LOW);
        digitalWrite(motor3,LOW);
        digitalWrite(motor4,HIGH);
        Serial.println("GO Forward !");
        easyvr.playSound(1, EasyVR::VOL_FULL);
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_LEFT:
        // write your action code here
        digitalWrite(motor1,HIGH);
        digitalWrite(motor2,LOW);
        digitalWrite(motor3,HIGH);
        digitalWrite(motor4,LOW);
        Serial.println("Turn left !");
        easyvr.playSound(2, EasyVR::VOL_FULL);
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_STOP:
        // write your action code here
        digitalWrite(motor1, LOW);
        digitalWrite(motor2, LOW); 
        digitalWrite(motor3, LOW);
        digitalWrite(motor4, LOW);
        Serial.println(" STOP !");
                easyvr.playSound(3, EasyVR::VOL_FULL);
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_RIGHT:
        // write your action code here
        digitalWrite(motor1, LOW);
        digitalWrite(motor2, HIGH); 
        digitalWrite(motor3, LOW);
        digitalWrite(motor4, HIGH);
        Serial.println(" Turn rigth !");
                easyvr.playSound(4, EasyVR::VOL_FULL);
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_BACK:
        // write your action code here
        digitalWrite(motor1, LOW);
        digitalWrite(motor2, HIGH); 
        digitalWrite(motor3, HIGH);
        digitalWrite(motor4, LOW);
        Serial.println(" Reverse !");
                easyvr.playSound(5, EasyVR::VOL_FULL);
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      }
      break;
    }
}

erka:
I'm doing the robot control the voice of using the easyvr. Give it a code you see.

Is there a question?

Are you receiving errors?
(That code compiles fine.)

Are you receiving errors?
(That code compiles fine.)

there is no errors, however is not work this code

there is no errors, however is not work this code

That does not give us much to go on.
What should it do ?
What does it do ?

Have you tried printing the variable being tested by the if statements to see what their values are ?

erka:
.......however is not work this code

If you really want help, you need to be more specific. "is not work this code" doesn't give any clues as to what may be wrong.
Make it as easy as possible for people to help you. Don't make it impossible.

A good place to start is the output to the serial monitor.

Do you see this:-
"EasyVR not detected!"
or this:-
"EasyVR detected!"

Do you see this:-
"Say a command in Group "

etc etc.

Copy and post the complete output from the serial monitor window. (Enclosed in code tags, needless to say.)
Also add any other relevant information describing the exact symptoms of the problem.

*Bob just said a similar thing as I was typing, but now that I've typed all of this......

OldSteve:
@erka, there is no 'EasyVRBridge' in the 'EasyVR' library. It's something that you appear to have invented.

There used to be, the last version that has it is 1.5.

oqibidipo:
There used to be, the last version that has it is 1.5.

Right, so not an invention after all. Just working from old, outdated code examples.

Sorry about that erka.

On an aside, it's a pity that more Arduino libraries aren't backward-compatible. It's a PITA sometimes.