EasyVR arduino library commands

Cannot find explanation or even a list of the commands to be used in C++ when using the EasyVR library.

I guess you didn’t search for it. It was the first link in my search…

I did search for it. If you’re thinking of this link - https://www.tigal.com/download/veear/ea … _3.6.6.pdf it does not contain the commands used in testeasyvr.

What did you search for? And no it’s no in that manual, but it is in another one.

arduino easyvr library commands

Too many words… Use “easyvr commands” first link…

I know there are some commands in that manual, but there is more info if you look under the EasyVR library folders.

C:\Users.…\Documents\Arduino\libraries\EasyVR\docs\html

Double click on Annotated.html (make sure that your browser opens html files). Use that to find more commands.

I did what you said. In testeasyvr there is a statement group = EasyVR::TRIGGER; //<-- start group (customize) . I want to change the group from TRIGGER to Group1. Have tried many combinations of the spelling, underscores etc and none compile. What I’m seeking is an explanation of the format of EasyVR:: so I can move on.

That line actually reads (in my example code).

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

If you notice, the “TRIGGER” isn’t doing anything anyway since it’s commented out…

But, I do know that if you exported the code out of Commander, it will be different. Please post you code in code tags.

I am downloading the latest version of EasyVR Commander at the moment.

In the last line of setup is what I’m referring to. You’re being very helpful and I appreciate it. I have to leave now and will be back tomorrow morning. Here’s the code

#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"
EasyVR easyvr(port);

//Groups and Commands
enum Groups
{
  GROUP_2  = 2,
};

enum Group2 
{
  G2_OK = 0,
};


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);

  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_2:
      switch (idx)
      {
      case G2_OK:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      }
      break;
    }
}

codlink - I’m back. If you’ve learned anything more I’d sure like to know about it.

The “TRIGGER” word is being defined in the library. I imagine you could change it, but the outcome would still be the same. Your “new” word would do the same thing that “TRIGGER” is doing. Why do you want to change it? Please explain what you want to happen.

Thanks for coming back. I want to load and train some speaker dependent words in the easyvr. I have already done this with easyvrcommander. I then want a function I can call to 1. listen and 2. return the spoken word which I believe will be in the form of a. group index number and b. the index number within that group. The easyvr and associated arduino are in a hand held remote. 2 a and b are then transmitted to the robot to do what is called for by these numbers. I have had a remote and robot working very well for a year so I’m very comfortable with all aspects except for easyvr. Today the remote has a keypad, the new remote will have one also but the easyvr will be taking the place of the keypad for most of the activity.