EasyVR требуется помощ

Hobigo
Offline
Зарегистрирован: 14.01.2013

Всем привет!

Не могу запустить шилд EasyVR. Кто имел с ним дело, пожалуйста откликнитесь! 

Команды записал через EasyVR Commander 3.4.10.

Хочу повторить для начала,вот эту конструкцию http://www.zipfelmaus.com/blog/arduino-speech-control-easyvr-shield/

Скетч не компилируется. Появляется много ошибок. Подскажите пожалуйста что нужо исправить. Заранее спасибо!

kimmel.dima
Offline
Зарегистрирован: 20.02.2014

А какие ошибки выдает? Не думаю, что на форуме это кому либо известно, кроме Вас, а телепаты сюда не заходят))

Hobigo
Offline
Зарегистрирован: 14.01.2013

Вот

sketch_feb23a.ino:1:26: error: token ";" is not valid in preprocessor expressions
In file included from sketch_feb23a.ino:11:
C:\arduino-1.0.3\libraries\NewSoftSerial/NewSoftSerial.h:33:2: error: #error NewSoftSerial has been moved into the Arduino core as of version 1.0. Use SoftwareSerial instead.
In file included from sketch_feb23a.ino:11:
C:\arduino-1.0.3\libraries\NewSoftSerial/NewSoftSerial.h:99: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)'
C:\arduino-1.0.3\hardware\arduino\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'
sketch_feb23a.ino: In function 'void setup()':
sketch_feb23a:46: error: 'cli' was not declared in this scope
sketch_feb23a:50: error: 'Serial' was not declared in this scope
sketch_feb23a:55: error: 'amp' was not declared in this scope
sketch_feb23a:55: error: 'quot' was not declared in this scope
sketch_feb23a:55: error: expected unqualified-id before '!' token
sketch_feb23a:55: error: expected primary-expression before ')' token
sketch_feb23a:55: error: expected `;' before ')' token
sketch_feb23a:59: error: 'LOW' was not declared in this scope
sketch_feb23a:60: error: 'amp' was not declared in this scope
sketch_feb23a:60: error: 'quot' was not declared in this scope
sketch_feb23a:60: error: expected initializer before '!' token
sketch_feb23a:60: error: expected primary-expression before ')' token
sketch_feb23a:60: error: expected `;' before ')' token
sketch_feb23a:67: error: 'OUTPUT' was not declared in this scope
sketch_feb23a:67: error: 'pinMode' was not declared in this scope
sketch_feb23a:68: error: 'digitalWrite' was not declared in this scope
sketch_feb23a.ino: In function 'void loop()':
sketch_feb23a:76: error: 'HIGH' was not declared in this scope
sketch_feb23a:78: error: 'Serial' was not declared in this scope
sketch_feb23a:78: error: 'amp' was not declared in this scope
sketch_feb23a:78: error: 'quot' was not declared in this scope
sketch_feb23a:78: error: 'Say' was not declared in this scope
sketch_feb23a:78: error: expected `;' before 'a'
sketch_feb23a:78: error: expected primary-expression before ')' token
sketch_feb23a:78: error: expected `;' before ')' token
sketch_feb23a:88: error: 'LOW' was not declared in this scope
sketch_feb23a:91: error: expected `)' before ';' token
sketch_feb23a:91: error: 'gt' was not declared in this scope
sketch_feb23a:91: error: expected primary-expression before '=' token
sketch_feb23a:91: error: expected `;' before ')' token
sketch_feb23a:98: error: expected `)' before ';' token
sketch_feb23a:98: error: expected primary-expression before '=' token
sketch_feb23a:98: error: expected `;' before ')' token
sketch_feb23a:164: error: expected `}' at end of input

 

kimmel.dima
Offline
Зарегистрирован: 20.02.2014

Примеры из библиотеки нормально компилируются?

Hobigo
Offline
Зарегистрирован: 14.01.2013

Все примеры компилируются нормально, кроме библиотеки NewSoftSerial

In file included from NewSoftSerialExample.pde:1:
C:\arduino-1.0.3\libraries\NewSoftSerial/NewSoftSerial.h:33:2: error: #error NewSoftSerial has been moved into the Arduino core as of version 1.0. Use SoftwareSerial instead.
In file included from NewSoftSerialExample.pde:1:
C:\arduino-1.0.3\libraries\NewSoftSerial/NewSoftSerial.h:99: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)'
C:\arduino-1.0.3\hardware\arduino\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'

 

kimmel.dima
Offline
Зарегистрирован: 20.02.2014
#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;
    }
}

А так?

Hobigo
Offline
Зарегистрирован: 14.01.2013

Попробывал ваш код. Вот какие ошибки появляются

C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:43:24: error: WConstants.h: No such file or directory
In file included from C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:45:
C:\arduino-1.0.3\libraries\NewSoftSerial\/NewSoftSerial.h:33:2: error: #error NewSoftSerial has been moved into the Arduino core as of version 1.0. Use SoftwareSerial instead.
In file included from C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:45:
C:\arduino-1.0.3\libraries\NewSoftSerial\/NewSoftSerial.h:99: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)'
C:\arduino-1.0.3\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp: In member function 'void NewSoftSerial::tx_pin_write(uint8_t)':
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:279: error: 'LOW' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp: In member function 'void NewSoftSerial::setTX(uint8_t)':
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:356: error: 'OUTPUT' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:356: error: 'pinMode' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:357: error: 'HIGH' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:357: error: 'digitalWrite' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:358: error: 'digitalPinToBitMask' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:359: error: 'digitalPinToPort' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:360: error: 'portOutputRegister' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp: In member function 'void NewSoftSerial::setRX(uint8_t)':
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:365: error: 'INPUT' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:365: error: 'pinMode' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:367: error: 'HIGH' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:367: error: 'digitalWrite' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:369: error: 'digitalPinToBitMask' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:370: error: 'digitalPinToPort' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:371: error: 'portInputRegister' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp: In member function 'virtual void NewSoftSerial::write(uint8_t)':
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:454: error: 'HIGH' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:454: error: 'LOW' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:460: error: 'byte' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:460: error: expected `;' before 'mask'
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:460: error: 'mask' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:474: error: 'byte' was not declared in this scope
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:474: error: expected `;' before 'mask'
C:\arduino-1.0.3\libraries\NewSoftSerial\NewSoftSerial.cpp:474: error: 'mask' was not declared in this scope

kimmel.dima
Offline
Зарегистрирован: 20.02.2014

У вас старая версия Arduino IDE?

Hobigo
Offline
Зарегистрирован: 14.01.2013

1.0.3