BitVoicer Code is NOT Working with me :'

Hello , I'm trying to setup this code in the link below to my Arduino ,But when I am compiling it by the Arduino 1.0.4 it gives me errors
This is the link for the code :

And these are the errors :

leds:16: error: 'BitVoicerSerial' does not name a type
leds.ino: In function 'void loop()':
leds:30: error: 'bitVoicer' was not declared in this scope
leds:16: error: 'BitVoicerSerial' does not name a type
leds.ino: In function 'void loop()':
leds:30: error: 'bitVoicer' was not declared in this scope

leds:16: error: 'BitVoicerSerial' does not name a type
leds.ino: In function 'void loop()':
leds:30: error: 'bitVoicer' was not declared in this scope

the code includes the bitvoicer.h library but i don't have it in the bitvoicer v1.1 and i have the new library of the bitvoicer11.h
but it is not working with the old code .

all the hardware work very well in the other examples but when i try this code it gives me errors

the code from this link :

in conclusion i tried to software this circlet But i cant because this circlet in an old version of the bitvoicer and i want the new code please :frowning: :frowning:

the circlet in this link :

this is the code :

//Includes the BitVoicer library to the sketch
#include <BitVoicer.h>

//Sets up the pins and default variables
int pinR = 3;
int pinY = 5;
int pinG = 6;
int blinkDelay = 250;
int sequenceDir = 0;
int lightLevel = 0;

//Creates a new instance of the BitVoicerSerial class
//Sets up serial port to 0
BitVoicerSerial bitVoicer = BitVoicerSerial(0);

void setup()
{
  //Starts serial communication and sets up the pinModes
  Serial.begin(9600);
  pinMode(pinR, OUTPUT);
  pinMode(pinY, OUTPUT);
  pinMode(pinG, OUTPUT);
}

void loop()
{
  //Retrieves data from serial buffer 
  bitVoicer.getData();
 
  //Quits the loop if no string data was returned from getData
  if (bitVoicer.strData == "")
  {
    return;
  }
 
  //Each of the next 'if' statements performs a different
  //task based on the data received from BitVoicer
  if (bitVoicer.strData == "wake")
  {
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(200);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    delay(200);
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(200);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    delay(200);
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(200);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    bitVoicer.strData = "";
    lightLevel = 0;
  }
  else if (bitVoicer.strData == "sleep")
  {
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(200);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    delay(200);
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(200);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    bitVoicer.strData = "";
    lightLevel = 0;
  }
  else if (bitVoicer.strData == "RH")
  {
    digitalWrite(pinR, HIGH);
    bitVoicer.strData = "";
    lightLevel = 255;
  }
  else if (bitVoicer.strData == "RL")
  {
    digitalWrite(pinR, LOW);
    bitVoicer.strData = "";
    lightLevel = 0;
  }
  else if (bitVoicer.strData == "YH")
  {
    digitalWrite(pinY, HIGH);
    bitVoicer.strData = "";
    lightLevel = 255;
  }
  else if (bitVoicer.strData == "YL")
  {
    digitalWrite(pinY, LOW);
    bitVoicer.strData = "";
    lightLevel = 0;
  }
  else if (bitVoicer.strData == "GH")
  {
    digitalWrite(pinG, HIGH);
    bitVoicer.strData = "";
    lightLevel = 255;
  }
  else if (bitVoicer.strData == "GL")
  {
    digitalWrite(pinG, LOW);
    bitVoicer.strData = "";
    lightLevel = 0;
  }
  else if (bitVoicer.strData == "blink")
  {
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(blinkDelay);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    delay(blinkDelay);
    lightLevel = 255;
  }
  else if (bitVoicer.strData == "BF")
  {
    blinkDelay = 100;
    bitVoicer.strData = "blink";
    lightLevel = 255;
  }
  else if (bitVoicer.strData == "BFF")
  {
    switch (blinkDelay)
    {
      case 500:
        blinkDelay = 250;
        break;
      case 250:
        blinkDelay = 100;
        break;
      default:
        break;
    }
    bitVoicer.strData = "blink";
    lightLevel = 255;
  }
  else if (bitVoicer.strData == "BS")
  {
    blinkDelay = 500;
    bitVoicer.strData = "blink";
    lightLevel = 255;
  }
  else if (bitVoicer.strData == "BSS")
  {
    switch (blinkDelay)
    {
      case 100:
        blinkDelay = 250;
        break;
      case 250:
        blinkDelay = 500;
        break;
      default:
        break;
    }
    bitVoicer.strData = "blink";
    lightLevel = 255;
  }
  else if (bitVoicer.strData == "sequence")
  {
    if (sequenceDir == 0)
    {
      digitalWrite(pinR, HIGH);
      delay(250);
      digitalWrite(pinR, LOW);
      digitalWrite(pinY, HIGH);
      delay(250);
      digitalWrite(pinY, LOW);
      digitalWrite(pinG, HIGH);
      delay(250);
      digitalWrite(pinG, LOW);
    }
    else
    {
      digitalWrite(pinG, HIGH);
      delay(250);
      digitalWrite(pinG, LOW);
      digitalWrite(pinY, HIGH);
      delay(250);
      digitalWrite(pinY, LOW);
      digitalWrite(pinR, HIGH);
      delay(250);
      digitalWrite(pinR, LOW);
    }
    lightLevel = 255;
  }
  else if (bitVoicer.strData == "revert")
  {
    if (sequenceDir == 0)
    {
      sequenceDir = 1;
    }
    else
    {
      sequenceDir = 0;
    }
    bitVoicer.strData = "sequence";
    lightLevel = 255;
  }
  else if (bitVoicer.strData == "ALLON")
  {
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    bitVoicer.strData = "";
    lightLevel = 255;
  }
  else if (bitVoicer.strData == "ALLOFF")
  {
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    bitVoicer.strData = "";
    lightLevel = 0;
  }
  else if (bitVoicer.strData == "brighter")
  {
    if (lightLevel < 255)
    {
      lightLevel += 85;
      analogWrite(pinR, lightLevel);
      analogWrite(pinY, lightLevel);
      analogWrite(pinG, lightLevel);
    }
    bitVoicer.strData = "";
  }
  else if (bitVoicer.strData == "darker")
  {
    if (lightLevel > 0)
    {
      lightLevel -= 85;
      analogWrite(pinR, lightLevel);
      analogWrite(pinY, lightLevel);
      analogWrite(pinG, lightLevel);
    }
    bitVoicer.strData = "";
  }
  else
  {
    Serial.println("ERROR:" + bitVoicer.strData);
    bitVoicer.strData = "";
  }
}

Moderator edit: CODE TAGS

leds:16: error: 'BitVoicerSerial' does not name a type

Typically because the header file was not included or was not found.

but when i try this code it gives me errors

This code?


i tried to software this circlet

You what?

PaulS:

leds:16: error: 'BitVoicerSerial' does not name a type

Typically because the header file was not included or was not found.

but when i try this code it gives me errors

This code?


i tried to software this circlet

You what?

1.i included the library but the code need an old library of bitvoicer and i have the new one :frowning:

2.The code in this link :
http://www.instructables.com/id/Speech-Recognition-with-BitVoicer-and-Arduino/

3.the circlet in the same link :

Use this code. From the discussion here - Wireless Audio Streaming and Speech Recognition (PART 2) - #7 by leandro4b - Audio - Arduino Forum;

#include <BitVoicer11.h>

//Instantiates the BitVoicerSerial class
BitVoicerSerial bvSerial = BitVoicerSerial();

//Stores true if the Audio Streaming Calibration tool
//is running
boolean sampleTest = false;
//Stores the data type retrieved by getData()
byte dataType = 0;
//Sets up the pins and default variables
int pinR = 3;
int pinY = 5;
int pinG = 6;
int lightLevel = 0;

void setup()
{
  //Sets the analog reference to external (AREF pin)
  //WARNING!!! If anything is conected to the AREF pin,
  //this function MUST be called first. Otherwise, it will
  //damage the board.
  bvSerial.setAnalogReference(BV_EXTERNAL);
  //Sets up the microcontroller to perform faster analog reads
  //on the specified pin
  bvSerial.setAudioInput(0);
  //Starts serial communication at 115200 bps
  Serial.begin(115200);
  //Sets up the pinModes
  pinMode(pinR, OUTPUT);
  pinMode(pinY, OUTPUT);
  pinMode(pinG, OUTPUT);
}

void loop()
{
  //Captures audio and sends it to BitVoicer if the Audio
  //Streaming Calibration Tool is running
  if (sampleTest == true)
  {
    //The value passed to the function is the time
    //(in microseconds) that the function has to wait before
    //performing the reading. It is used to achieve about
    //8000 readings per second.
    bvSerial.processAudio(46);
  }
  
  //Captures audio and sends it to BitVoicer if the Speech
  //Recognition Engine is running
  if (bvSerial.engineRunning)
  {
    //The value passed to the function is the time
    //(in microseconds) that the function has to wait before
    //performing the reading. It is used to achieve about
    //8000 readings per second.
    bvSerial.processAudio(46);
  }
}

//This function runs every time serial data is available
//in the serial buffer after a loop
void serialEvent()
{
  //Reads the serial buffer and stores the received data type
  dataType = bvSerial.getData();
  
  //Changes the value of sampleTest if the received data was
  //the start/stop sampling command
  if (dataType == BV_COMMAND)
      sampleTest = bvSerial.cmdData;
  
  //Signals BitVoicer's Speech Recognition Engine to start
  //listening to audio streams after the engineRunning status
  //was received
  if (dataType == BV_STATUS && bvSerial.engineRunning == true)
    bvSerial.startStopListening();
  
  //Checks if the data type is the same as the one in the
  //Voice Schema
  if (dataType == BV_STR)
    setLEDs();
}

//Performs the LED changes according to the value in
//bvSerial.strData
void setLEDs()
{
  if (bvSerial.strData == "wake")
  {
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(200);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    delay(200);
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(200);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    delay(200);
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(200);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    lightLevel = 0;
  }
  else if (bvSerial.strData == "sleep")
  {
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(200);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    delay(200);
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(200);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    lightLevel = 0;
  }
  else if (bvSerial.strData == "RH")
  {
    digitalWrite(pinR, HIGH);
    lightLevel = 255;
  }
  else if (bvSerial.strData == "RL")
  {
    digitalWrite(pinR, LOW);
    lightLevel = 0;
  }
  else if (bvSerial.strData == "YH")
  {
    digitalWrite(pinY, HIGH);
    lightLevel = 255;
  }
  else if (bvSerial.strData == "YL")
  {
    digitalWrite(pinY, LOW);
    lightLevel = 0;
  }
  else if (bvSerial.strData == "GH")
  {
    digitalWrite(pinG, HIGH);
    lightLevel = 255;
  }
  else if (bvSerial.strData == "GL")
  {
    digitalWrite(pinG, LOW);
    lightLevel = 0;
  }
  else if (bvSerial.strData == "ALLON")
  {
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    lightLevel = 255;
  }
  else if (bvSerial.strData == "ALLOFF")
  {
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    lightLevel = 0;
  }
  else if (bvSerial.strData == "brighter")
  {
    if (lightLevel < 255)
    {
      lightLevel += 85;
      analogWrite(pinR, lightLevel);
      analogWrite(pinY, lightLevel);
      analogWrite(pinG, lightLevel);
    }
  }
  else if (bvSerial.strData == "darker")
  {
    if (lightLevel > 0)
    {
      lightLevel -= 85;
      analogWrite(pinR, lightLevel);
      analogWrite(pinY, lightLevel);
      analogWrite(pinG, lightLevel);
    }
  }
  else
  {
    bvSerial.startStopListening();
    bvSerial.sendToBV("ERROR:" + bvSerial.strData);
    bvSerial.startStopListening();
  }
}

hi. this is also my problem. dont know where to get the bitvoicer11.h.

leicamara:
hi. this is also my problem. dont know where to get the bitvoicer11.h.

well i have the bitvoicer.h and bitvoicer.cpp
imported it , i also manually copied it to Arduino library folder but it didnt work.
the other command, such as bvSerial.setAudioInput and others are colored in orange. but the header #include <BitVoicer11.h> is colored in black just like a normal text.

but the header ... is colored in black just like a normal text.

Color does not mean squat. The sooner you quit attaching significance to color, the happier you will be.

i also manually copied it to Arduino library folder

There are two of them. Which one did you copy the files to, and in which folder in the libraries directory did you put them in?