Introduction
Recently I’ve found an quite interesting Arduino shield on: http://www.veear.eu/Products/EasyVRShield.aspx. Using this shield you can control your Arduino using speech commands.
The shield consists of these components:
– EasyVR Arduino Shield (includes EasyVR module)
– Microphone
On the website you can also find following free software downloads (see link above):
– User manual
– EasyVR Commander
– Arduino Libraries
Following shops sell the EasyVR shield: http://www.veear.eu/WheretoBuy.aspx
It costs around 40€ or 50$.
Demo
In this demo I control a LED with my voice and the EasyVR shield.
For this demo I also use an Arduino, that has been kindly provided by Farnell.com.
Overview Arduino: http://de.farnell.com/arduino
Arduino schematic: http://arduino.cc/en/uploads/Main/arduino-uno-schematic.pdf
Link to product page: http://de.farnell.com/arduino/a000046/board-arduino-uno/dp/1848687?ICID=i-9ec8-00001000
Step 1: Software Installation
Install the „EasyVR Commander“ software [Link].
Before you run the software, make sure you run the program with administrator privileges.
But don’t start the software at the moment.
Step 2: Prepare hardware
Put the shield and the Arduino together and connect the mic to the shield (J11).
Put Jumper J12 at position „PC“.
Connect the Arduino to the PC via USB.
Step 3: Train the EasyVR Shield
Now run „EasyVR Commander“ and connect to the serial port of the Arduino USB connection.
Click in the group list on Index 0 – Trigger. Add a new command, name it e.g. „ARDUINO“. Then click on „Train Command“. And speak the word „Arduino“ in the mic. And a second time, when the software tells you so.
Click in the group list on Index 1 – Group. Add a new command, name it e.g. „LED_ON“. Then click on „Train Command“. And speak the words „LED on“ in the mic. And a second time, when the software tells you so.
And add a second command „LED_OFF“ and train this command as well.
Note: LED_AN is LED_ON and LED_AUS is LED_OFF.
Now your EasyVR is configured. We finally generate some code for the microcontroller inside of the Arduino. In EasyVR Commander click on File->Generate code.
Disconnect your Arduino from USB and change jumper J12 to SW.
Step 4: Some Arduino code
Install the EasyVR Arduino libraries (see first link) to the Arduino IDE library folder.
I slightly altered the previously generated code to control a LED. The LED is connected to pin 11:
[cpp]
#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_0 = 0,
GROUP_1 = 1,
};
enum Group0
{
G0_ARDUINO = 0,
};
enum Group1
{
G1_LED_AN = 0,
G1_LED_AUS = 1,
};
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(3);
group = EasyVR::TRIGGER; //<– start group (customize)
pinMode(11, OUTPUT);
digitalWrite(11, LOW); // set the LED off
}
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);
}
group = GROUP_0;
}
}
void action()
{
switch (group)
{
case GROUP_0:
switch (idx)
{
case G0_ARDUINO:
// write your action code here
group = GROUP_1; //<– or jump to another group X for composite commands
break;
}
break;
case GROUP_1:
switch (idx)
{
case G1_LED_AN:
// write your action code here
group = GROUP_0; //<– or jump to another group X for composite commands
digitalWrite(11, HIGH); // set the LED on
break;
case G1_LED_AUS:
// write your action code here
group = GROUP_0; //<– or jump to another group X for composite commands
digitalWrite(11, LOW); // set the LED off
break;
}
break;
}
}
[/cpp]
Compile and upload this code. Your Arduino should now do something like this:
can u help with my program is simular to your i have a trigger activate sound sensor, to commands activate and decativate switch but i cant upload my program on arduino can u see where i have gone wrong . when i try your program it doesnt like NewSoftSerial port because it does have a type
#include
NewSoftSerial port(12,13);
#include
EasyVR easyvr(port);
//Groups and Commands
enum Groups
{
GROUP_0 = 0,
GROUP_1 = 1,
};
enum Group0
{
G0_ACTIVATE_SND_SENSOR = 0,
};
enum Group1
{
G1_ACTIVATE = 0,
G1_DEACTIVATE_SWITCH = 1,
};
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; //= 0)
{
// built-in trigger (ROBOT)
// group = GROUP_X; = 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_ACTIVATE_SND_SENSOR:
// 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_ACTIVATE:
// write your action code here
group = GROUP_0; //<– or jump to another group X for composite commands
digitalWrite(11, HIGH); // set the LED on
break;
case G1_DEACTIVATE_SWITCH:
// write your action code here
group = GROUP_0; //<– or jump to another group X for composite commands
digitalWrite(11, LOW); // set the LED off
break;
}
break;
}
}
@arton: if you have the easyvr shield, you should try a different jumper setting on jumper J12
see page 17: http://download.tigal.com/veear/EasyVR_User_Manual_3.3.pdf
hello..
i am new to this easyvr and need help for connecting arduino uno with easyvr..
i am not using shield..
@uzma:
that’s eays, have a look at this pdf, on page 11:
http://download.tigal.com/veear/EasyVR_User_Manual_3.3.pdf
Pingback: Hackaday Links April 5, 2012 - Hack a Day
Pingback: Hackaday Links April 5, 2012 » Geko Geek
say me „easyvr not detected“ help me please
@gogy: did you checked the manual? what configuration do you have – easy vr-shield + arduino or direct connection between the easy vr board and the arduino?
the second
hello, how do I configurer this in terminal? excuse my english is bad
Do you used the arduino software or another program to upload the sample program to the microcontroller?
I live in Brazil, I don’t speak very well English and I am using translator “ Globalink “ and I am with difficulties of doing the recording of the sound table in my easyvr shield, and in spite of following the instructions of the video in the site http://www.youtube.com/watch?v=SThR-jyoplk..
I used the program of sound “ compress Sensory quickSynthesis 5 „, as taught in the video, jumper position “ UP „, and downloads for the program Easy VR shield, however i am not getting to do the transfer of the sound for the easyvr shield, when I change the jumper for position “ PC “ the sound table it doesn’t show up in the program Easyvr Comander left side in the end indicating that was not recorded.
Thank you for the attention and for the help
Hi
I have bought the EasyVR and Arduino shield
do not have any program experience
like your program to control LED with voice command
could give the program code i can use to do this with my EasyVR
I copied your program but did hot work with voice
everything worked up generating code in the commander
Thank you so much
im getting a error Easy.h has not been declared. im lost
#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_0 = 0,
GROUP_1 = 1,
};
enum Group0
{
G0_ARDUINO = 0,
};
enum Group1
{
G1_LED_ON = 0,
G1_LED_OFF = 1,
};
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; //= 0)
{
// built-in trigger (ROBOT)
// group = GROUP_X; = 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_ARDUINO:
// 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_LED_ON:
// write your action code here
// group = GROUP_X; <– or jump to another group X for composite commands
break;
case G1_LED_OFF:
// write your action code here
// group = GROUP_X; <– or jump to another group X for composite commands
break;
}
break;
}
}
hello, I do copy your code but I failed to compile it. the error ‚ ‚cli‘ is not declare in this scope ‚ appear. I’ve tried to find out the problem but I still cant get it. will you help me on this problem?
thank you. 😀
@yusuf: you may find this website useful: http://www.arduino.cc/playground/Main/AVR
It explains the cli() and sei() function.
I am trying to upload your code to my arduino but it says ‚NewSoftSerial‘ does not name a type‘
any ideas on how to fix this?
Hi!!! I’m in trouble with first test on arduino… on commander it’s all ok, but when i try to test with example sketch, on the serial monitor says “EasyVR not detected!” what can be wrong? Sorry… if someone can help me, can reply me by mail? nytro1981@gmail.com thanks!!!!!
Hi, I´m brazilian. My english isnt good, sry for that! So I´m had trouble using this code, so i tried to repair what is gone wrong… and I got it!
<– I don´t know what it means but by the way it works.
here is 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_0 = 0,
GROUP_1 = 1,
};
enum Group0
{
G0_ARDUINO = 0,
};
enum Group1
{
G1_LED_AN = 0,
G1_LED_AUS = 1,
};
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(3);
group = EasyVR::TRIGGER; //<– start group (customize)
pinMode(11, OUTPUT);
digitalWrite(11, LOW); // set the LED off
}
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 (idx>= 0)
{
Serial.print(„Error“);
Serial.println(err, HEX);
}
group = GROUP_0;
}
}
void action()
{
switch (group)
{
case GROUP_0:
switch (idx)
{
case G0_ARDUINO:
// write your action code here
group = GROUP_1; //<– or jump to another group X for composite commands
break;
}
break;
case GROUP_1:
switch (idx)
{
case G1_LED_AN:
// write your action code here
group = GROUP_0; //<– or jump to another group X for composite commands
digitalWrite(11, HIGH); // set the LED on
break;
case G1_LED_AUS:
// write your action code here
group = GROUP_0; //<– or jump to another group X for composite commands
digitalWrite(11, LOW); // set the LED off
break;
}
break;
}
}
Hi again! I tested my own code by copying from this site but I discovered a problem. The problem is using control+c control+v to arduino IDE doesnt work. this site have a problem about simbols. („) is the problem. so if you replace all („) of my code again, you will see the word on the IDE will turn to blue color than black.
oh thankyou, I manage to try this code when im move the library correctly. thank you.
Can someone help me how to interface easyvr with arduino uno module because i am error of bridge connection
Hello, can someone help me! I will make abraille learning board with 2 braille cells each cell consists of 6 dots the user must press on the buttons(raised dots) to make aletter or number and combine them to make words…. The output must be voice only.How can I use arduino to make the voice output.
i want to ask what is the software that i should use for coding, im new with arduino!!!
Hi,
Can someone help me to compile the code with a Teensy board instead of an Arduino???
Thank you so much.
(“) is the problem. so if you replace all (“) of my code again, you will see the word on the IDE will turn to blue color than black.
i do this and the color become blue but in compiler there is a problem “ conflicting declaration ’softwareserial port‘ how cani resolve it ?
finally, i upload the program but the led is on all the time and doesn’t response to voice ,what’s the problem ? and after uploading i change the mode of j12 or keep it in sw mode
Hi,
so this is funny, when I say led_off arduino turns the led ON! and when I say ON it turns the led OFF! hmmmm this is so funny. here my code:
(the led is on from the beginning!)
hope you can find the little devil 😉
#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_0 = 0,
GROUP_1 = 1,
};
enum Group0
{
G0_DAVID = 0,
};
enum Group1
{
G1_LED_AN = 0,
G1_LED_AUS = 1,
};
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(10);
easyvr.setLanguage(3);
group = EasyVR::TRIGGER; //= 0)
{
// built-in trigger (ROBOT)
// group = GROUP_X; = 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_DAVID:
// write your action code here
group = GROUP_1;
break;
}
break;
case GROUP_1:
switch (idx)
{
case G1_LED_AN:
group = GROUP_0; //<– or jump to another group X for composite commands
digitalWrite(11, HIGH);
break;
case G1_LED_AUS:
group = GROUP_0; //<– or jump to another group X for composite commands
digitalWrite(11, LOW); // set the LED off
break;
}
break;
}
}
@Albert: How did you connect the LED? K to GND and A to the digital output?
„NewSoftSerial“ does not name a type
I installed easy vr libraries, I restarted the arduino application, but still it doesnt work
How can i solve this?
@Christian:
maybe this might help:
http://electronics.stackexchange.com/questions/12978/correct-location-of-header-file-for-arduino-sketches
http://forum.arduino.cc/index.php?topic=65394.0
hi…,i purchased EASY VR alone with out shield…,i’mm working on it with AURDINO NANO. i’m unable to program the easy vr alone with aurdino..
can the „easy vr shield“ program can be used for EASY VR alone connected to „aurdino nano“….? please guide me…..!
hi….i purchased easy vr alone and i dont have easy vr shield. i’m trying to interface the easy vr with arudino nano. can i use your program for the easy vr alone with out any shield.please guide me so that i can move ahead.
waiting for your reply.
your bro-praveen reddy
@praveen: hey, look at the manual, at page 13 (http://download.tigal.com/veear/EasyVR_User_Manual_3.4.2.pdf), this should help.
How to put the EASY VR module in sleep mode…? Help.
Hello,
I have an Arduino Mega 2560 and the EasyVR shield. When I use EasyVR Commander, I can only train the trigger command. Everything else I try to train it tells me „Training Error: Recognition Failed“.
This is the only issue I’m having since I can test the trigger command as well as the wordlist. I even tried using the same command on the group lists but even that tells me the message.
Any help is appreciated.
The same error as for LUCA.
Easyvr not detected:
Everything complie, works and all other software are OK…but not the easyvr.
It seems EasyVr is shit…very very sensitive…and mybe broken.
Lots of people have the same errors but nobody knows the answer…
Hello,
I’m making a project with an easyvr voice recognition module to make a robot store and give things. Do you think that it is possible to make a command to make the robot record a new command ? for example, when somebody gives it an apple, he says „apple“ and the robot puts the apple on a free place and makes a new command. When the user says again „apple“ (or „give me the apple“), the robot should remember where he stored it and give it to the user.
Do you think that it is possible with the easyvr please ?
Thank you very much !
(sorry my english is bad I’m French)
@Elsa: Hi Elsa,
I think, this might be too diffucult. You always have to use the PC software to teach new words. Maybe you can ask the manufacturer, what they would do?
@SES
Hi SES,
There is a programm I think would work :
page 28 of the User Manual :
http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Dev/Arduino/Shields/EasyVR_User_Manual_3.3.pdf
But I don’t know if it works with the arduino…
below page 35, there is somrthing with arduino but I don’t know how to make the programm…
Nice tutorial I’ve had a headache for the last 2 days fiddling over getting my EasyVR to work with my shield because no explains the coding. Great code. 5 Star Results!!
arton you have Arduino 1.0 you need to go delete NewSoftSerial and SoftwareSerial folders ion your library.
Delete Documents/Arduino/libraries/SoftwareSerial
Delete Documents/Arduino/libraries/NewSoftSerial
http://forum.arduino.cc/index.php?topic=203045.msg1496187#msg1496187
hi all.
I’m having problems with the easyVR commander software. Whenever I’m trying to train a word in any of the groups,passwordI get an error that says „training error: recognition failure“ However when I train in the Trigger area it’s fine. Does anyone have experience with this problem or know a work around?
Hi!
I am making a project that can control 16 LEDs by giving command to easyvr.i.e.
When I say ON1, LED no 1 will light up. The thing is, I want to reduce the number of output pin that is used on the Arduino. I am thinking of using digital shifter (74HC595) but I am not really sure how to do it. Do you have any idea?
Please correct me if the next statement is wrong. The connection between easyvr and arduino are using Pin 12, 13, 5v and GND on Arduino Uno.
My problem is that I put the code and appears me two errors (error : conflicting return type specified for ‚ virtual void SoftwareSerial :: write ( uint8_t ) ‚ and the other ( ‚ virtual size_t Print :: write ( uint8_t ) ‚ overriding what would be the solution to min ?
this is my 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_0 = 0,
GROUP_1 = 1,
GROUP_16 = 16 ,
} ;
enum Group0
{
G0_UNO = 0,
} ;
enum Group1
{
G1_ATIVAR = 0,
G1_PARTIDA = 1,
G1_LANTERNA = 2
G1_DESLIGAR_LANTERNA = 3
G1_FAROIS = 4
G1_DESLIGAR_FAROIS = 5
G1_DESATIVAR = 6
} ;
enum Group16
{
G16_RODRIGO = 0,
} ;
EasyVRBridge bridge ;
int8_t group , idx ;
void setup ( )
{
/ / Bridge mode ?
if ( bridge.check () )
{
(CLI );
bridge.loop (0, 1 , 12, 13);
}
/ / Normally run
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 / / = 0 )
{
/ / Built -in trigger ( ROBOT )
/ / Group = GROUP_X ; = 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 / / or timeout errors
{
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)
{
GROUP_0 case :
switch ( idx )
{
G0_UNO case :
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
}
break;
GROUP_1 case :
switch ( idx )
{
G1_ATIVAR case :
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
G1_PARTIDA case :
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
G1_LANTERNA case :
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
G1_DESLIGAR_LANTERNA case :
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
G1_FAROIS case :
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
G1_DESLIGAR_FAROIS case :
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
G1_DESATIVAR case :
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
}
break;
GROUP_16 case :
switch ( idx )
{
G16_RODRIGO case :
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
}
break;
}
}
actually this code is here ! !
# define RELAYA 3
# define RELAYB 4
# define RELAYC 5
# define RELAYD 6
# define RELAYE 7
# define RELAYF 8
# 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
LDR int ;
int cont ;
int i;
# include “ EasyVR.h “
EasyVR easyvr (port ) ;
/ / Groups and Commands
enum Groups
{
GROUP_0 = 0,
GROUP_1 = 1,
GROUP_16 = 16 ,
} ;
enum Group0
{
G0_UNO = 0,
} ;
enum Group1
{
G1_ATIVAR = 0,
G1_PARTIDA = 1,
G1_LANTERNA = 2
G1_DESLIGAR_LANTERNA = 3
G1_FAROIS = 4
G1_DESLIGAR_FAROIS = 5
G1_DESATIVAR = 6
} ;
enum Group16
{
G16_RODRIGO = 0,
} ;
EasyVRBridge bridge ;
int8_t group , idx ;
void setup ( )
{
pinMode ( RELAYA , OUTPUT ) ;
pinMode ( RELAYB , OUTPUT ) ;
pinMode ( RELAYC , OUTPUT ) ;
pinMode ( RELAYD , OUTPUT ) ;
pinMode ( RELAYE , OUTPUT ) ;
pinMode ( RELAYF , OUTPUT ) ;
/ / Bridge mode ?
if ( bridge.check () )
{
(CLI );
bridge.loop (0, 1 , 12, 13);
}
/ / Normally run
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 ;
easyvr.playSound ( 0, EasyVR :: VOL_FULL );
group = GROUP_0 / / < – 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) ;
of
{
LDR = 0;
for (i = 0, i < = 10, i + +)
{
cont = analogRead ( A0 ) ;
LDR = LDR + cont ;
delay ( 20 ) ;
}
LDR = LDR/10 ;
Serial.println (LDR );
( LDR < = 200 ) ( digitalWrite ( RELAYE , HIGH ) ) : ( digitalWrite ( RELAYE , LOW ) );
( LDR = 0 )
{
/ / Built -in trigger ( ROBOT )
/ / Group = GROUP_X ; = 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 / / or timeout errors
{
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)
{
GROUP_0 case :
switch ( idx )
{
G0_UNO case :
easyvr.playSound ( 4 EasyVR :: VOL_FULL );
group = GROUP_16 ;
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
}
break;
GROUP_1 case :
switch ( idx )
{
G1_ATIVAR case :
digitalWrite ( RELAYA , HIGH ) ;
group = GROUP_1 ;
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
G1_PARTIDA case :
easyvr.playSound ( 3 EasyVR :: VOL_FULL );
digitalWrite ( RELAYB , HIGH ) ;
delay ( 1000) ;
digitalWrite ( RELAYB , LOW ) ;
group = GROUP_1 ;
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
G1_LANTERNA case :
digitalWrite ( RELAYC , HIGH ) ;
group = GROUP_1 ;
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
G1_DESLIGAR_LANTERNA case :
digitalWrite ( RELAYC , LOW ) ;
group = GROUP_1 ;
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
G1_FAROIS case :
digitalWrite ( RELAYD , HIGH ) ;
group = GROUP_1 ;
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
G1_DESLIGAR_FAROIS case :
digitalWrite ( RELAYD , LOW ) ;
group = GROUP_1 / / write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
G1_DESATIVAR case :
digitalWrite ( RELAYA , LOW ) ;
group = GROUP_1 ;
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
}
break;
GROUP_16 case :
switch ( idx )
{
G16_RODRIGO case :
easyvr.playSound ( 1 :: EasyVR VOL_FULL );
group = GROUP_1 ;
/ / Write your action code here
/ / Group = GROUP_X ; < – or jump to another group X is composite commands
break;
}
break;
}
}
hi all.
I’m having problems with the easyVR commander software. Whenever I’m trying to train a word in any of the groups,passwordI get an error that says “training error: recognition failure” However when I train in the Trigger area it’s fine. Does anyone have experience with this problem or know a work around?
Is your J7 Pin in the right position(There are 4 sets of pins located on one side of the EasyVR shield. Use PC when connecting to the EasyVR Commander, use UP when using QuickSynthesis, use SW when uploading code and when using it normally) Your Microphone could be disconnected. Contact me if you have any other questions
Hi all
I don’t know how to solve this … my Arduino isn’t familiar with this line
NewSoftSerial port(12,13);
help please…
Thanks
Maybe you didn’t include the NewSoftSerial Library?
#include
Servo pinky, ringF, middleF, indexF, thumb;
int bend = 800, straight = 2200, half = 1800, wait = 500, pbend = 2200, pstraight = 800, phalf = 1300;
#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_0 = 0,
GROUP_1 = 1,
};
enum Group0
{
G0_JILL = 0,
};
enum Group1
{
G1_TEST = 0,
G1_PINCH = 1,
G1_GRAB = 2,
G1_ROCK = 3,
G1_GNARLY = 4,
G1_POINT = 5,
G1_PEACE = 6,
G1_FLICK = 7,
G1_NEUTRAL = 8,
G1_TYPE = 9,
G1_RELAX = 10,
G1_MOUSE = 11,
G1_WAVE = 12,
G1_THUMBS_UP = 13,
G1_PENCIL = 14,
};
EasyVRBridge bridge;
int8_t group, idx;
void setup()
{
pinky.attach(3);
ringF.attach(5);
middleF.attach(6);
indexF.attach(9);
thumb.attach(10);
neutral();
delay(500);
// 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; //= 0)
{
// built-in trigger (ROBOT)
group = GROUP_1;
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_JILL:
// write your action code here
group = GROUP_1;
break;
}
break;
case GROUP_1:
switch (idx)
{
Serial.println(„here“);
case G1_TEST:
test();
break;
case G1_PINCH:
pinch();
break;
case G1_GRAB:
grab();
break;
case G1_ROCK:
rock();
break;
case G1_GNARLY:
gnarly();
break;
case G1_POINT:
point();
break;
case G1_PEACE:
peace();
break;
case G1_FLICK:
flick();
break;
case G1_NEUTRAL:
neutral();
break;
case G1_TYPE:
type();
break;
case G1_RELAX:
neutral();
group = GROUP_0;
break;
case G1_MOUSE:
mouse();
break;
case G1_WAVE:
wave();
break;
case G1_THUMBS_UP:
thumbsup();
break;
case G1_PENCIL:
pencil();
break;
}
break;
}
}
void test()
{
Serial.println(„HERE“);
drive(pinky, pbend);
drive(pinky, pstraight);
drive(ringF, bend);
drive(ringF, straight);
drive(middleF, bend);
drive(middleF, straight);
drive(indexF, bend);
drive(indexF, straight);
drive(thumb, bend);
drive(thumb, straight);
}
void pinch()
{
qDrive(thumb, bend);
qDrive(ringF, straight);
qDrive(middleF, straight);
qDrive(pinky, pstraight);
delay(200);
qDrive(indexF, bend);
}
void grab()
{
qDrive(indexF, bend);
qDrive(thumb, bend);
qDrive(ringF, bend);
qDrive(middleF, bend);
qDrive(pinky, pbend);
}
void rock()
{
qDrive(middleF, bend);
delay(200);
qDrive(indexF, straight);
qDrive(thumb, straight);
qDrive(ringF, bend);
qDrive(pinky, pstraight);
}
void gnarly()
{
qDrive(middleF, bend);
delay(200);
qDrive(indexF, bend);
qDrive(thumb, straight);
qDrive(ringF, bend);
qDrive(pinky, pstraight);
}
void point()
{
qDrive(indexF, straight);
qDrive(thumb, bend);
qDrive(ringF, bend);
qDrive(middleF, bend);
qDrive(pinky, pbend);
}
void peace()
{
qDrive(indexF, straight);
qDrive(thumb, bend);
qDrive(ringF, bend);
qDrive(middleF, straight);
qDrive(pinky, pbend);
}
void flick()
{
qDrive(indexF, bend);
qDrive(thumb, bend);
qDrive(ringF, bend);
qDrive(middleF, straight);
qDrive(pinky, pbend);
}
void neutral()
{
qDrive(indexF, straight);
qDrive(thumb, straight);
qDrive(ringF, straight);
qDrive(middleF, straight);
qDrive(pinky, pstraight);
}
void type()
{
qDrive(thumb, half);
qDrive(pinky, phalf);
qDrive(indexF, half);
qDrive(middleF, half);
qDrive(ringF, half);
}
void mouse()
{
qDrive(thumb, bend);
qDrive(pinky, pbend);
qDrive(indexF, bend);
qDrive(middleF, straight);
qDrive(ringF, straight);
}
void wave()
{
for(int i = 0; i < 3; i++)
{
qDrive(middleF, bend);
delay(200);
qDrive(thumb, straight);
qDrive(pinky, pbend);
qDrive(indexF, bend);
qDrive(ringF, bend);
delay(500);
neutral();
delay(500);
}
}
void thumbsup()
{
qDrive(middleF, bend);
delay(200);
qDrive(thumb, straight);
qDrive(pinky, pbend);
qDrive(indexF, bend);
qDrive(ringF, bend);
}
void pencil()
{
qDrive(middleF, bend);
delay(200);
qDrive(thumb, bend);
qDrive(pinky, pbend);
qDrive(ringF, bend);
delay(500);
qDrive(indexF, bend);
}
void drive(Servo s, int pos)
{
s.writeMicroseconds(pos);
delay(wait);
}
void qDrive(Servo s, int pos)
{
s.writeMicroseconds(pos);
}
sir im having problem with newsoftserial port(12,13),,,,and also with EasyVr(port)
when i try to compile it,it shows an error with highligting these two instruction
what to do??????????
please reply its very urgent and important
Hello! I’m using easyVR mount on Ethernet shield, separately they works but when I put together the bridge and easy vr are not detected. Something wrong with the pins??
Daniel, the Ethernet Shield uses pins 10, 11, 12, and 13 on the Arduino Uno. The EasyVR Shield uses pins 12 and 13 as the communication to the Arduino. You should change the code for your EasyVR from
„NewSoftSerial port(12,13)“ to „NewSoftSerial port(8,9)“ and that might work, but if it doesn’t, look up how to connect 2 arduinos together. Then you might be able to figure out how to get the two to work together. Good Luck
why am I getting ëasyVR cot detected “ on serial monitor?
I have all the SD and SI command on easyVR and well soldered to Arduino.
pl help.
hello, i want ask you
why after verify, appear message „token „;“ is not valid in preprocessor expressions“ ? please help me hehehe