What is wrong with this code????

#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#include "Platform.h"
#include "SoftwareSerial.h"
#ifndef CDC_ENABLED
// Shield Jumper on SW
SoftwareSerial port(12,13);
#else
// Shield Jumper on HW (for Leonardo)
#define port Serial1
#endif
#else // Arduino 0022 - use modified NewSoftSerial
#include "WProgram.h"
#include "NewSoftSerial.h"
NewSoftSerial port(12,13);
#endif

#include "EasyVR.h"

EasyVR easyvr(port);

int LED = 8 ;

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

enum Group0
{
G0_DEVICE = 0,
};

enum Group1
{
G1_LED_ON = 0,
G1_LED_OFF = 1,
};

EasyVRBridge bridge;

int8_t group, idx;

void setup()
{
#ifndef CDC_ENABLED
// bridge mode?
if (bridge.check())
{
cli();
bridge.loop(0, 1, 12, 13);
}
// run normally
Serial.begin(9600);
Serial.println("Bridge not started!");
#else
// bridge mode?
if (bridge.check())
{
port.begin(9600);
bridge.loop(port);
}
Serial.println("Bridge connection aborted!");
#endif
port.begin(9600);

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()
{
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 GO_DEVICE:0
group = GROUP_1 ;

// 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:
digital.Write(8,HIGH)
// write your action code here
// group = GROUP_X; <-- or jump to another group X for composite commands
break;
case G1_LED_OFF:
digital.Write(8,LOW)
// write your action code here
// group = GROUP_X; <-- or jump to another group X for composite commands
break;
group = GROUP_0;
delay(5);
}
break;
}
}

This is a code to turn one LED on and off using an EasyVR Shield 2.0 + Arduino UNO R3

The error I am getting says 'G0_DEVICE' was not declared in this scope. ???What does this mean and how can I fix it?
The yellow highlighted line above is what is highlighted in the Arduino program when I try to verify the code and get the error.

Any help is really appreciated. Been troubleshooting for days and still can't voice command one LED...

#if defined(ARDUINO) && ARDUINO >= 100
  #include "Arduino.h"
  #include "Platform.h"
  #include "SoftwareSerial.h"
#ifndef CDC_ENABLED
  // Shield Jumper on SW
  SoftwareSerial port(12,13);
#else
  // Shield Jumper on HW (for Leonardo)
  #define port Serial1
#endif
#else // Arduino 0022 - use modified NewSoftSerial
  #include "WProgram.h"
  #include "NewSoftSerial.h"
  NewSoftSerial port(12,13);
#endif

#include "EasyVR.h"

EasyVR easyvr(port);
 
  int LED = 8 ;

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

enum Group0 
{
  G0_DEVICE = 0,
};

enum Group1 
{
  G1_LED_ON = 0,
  G1_LED_OFF = 1,
};


EasyVRBridge bridge;

int8_t group, idx;

void setup()
{
#ifndef CDC_ENABLED
  // bridge mode?
  if (bridge.check())
  {
    cli();
    bridge.loop(0, 1, 12, 13);
  }
  // run normally
  Serial.begin(9600);
  Serial.println("Bridge not started!");
#else
  // bridge mode?
  if (bridge.check())
  {
    port.begin(9600);
    bridge.loop(port);
  }
  Serial.println("Bridge connection aborted!");
#endif
  port.begin(9600);

  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()
{
  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 GO_DEVICE:0
 group = GROUP_1 ;
       
 // 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:
 digital.Write(8,HIGH)
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_LED_OFF:
 digital.Write(8,LOW)
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
 group = GROUP_0;
 delay(5);
      }
      break;
    }
}

This is a code to turn one LED on and off using an EasyVR Shield 2.0 + Arduino UNO R3

The error I am getting says 'G0_DEVICE' was not declared in this scope. ???What does this mean and how can I fix it?
The yellow highlighted line above is what is highlighted in the Arduino program when I try to verify the code and get the error.

Any help is really appreciated. Been troubleshooting for days and still can't voice command one LED...

Moderator edit: code tags added, colour tags removed. Sorry, I can't (be bothered to) do anything about the indentation.

The error I am getting says 'G0_DEVICE' was not declared in this scope. ???What does this mean and how can I fix it?

It means that G0_DEVICE is not defined where you are trying to use it. Why do you think it is?

Perhaps you mean something like Group0::G0_DEVICE.

The error I am getting says 'G0_DEVICE' was not declared in this scope. ???What does this mean and how can I fix it

Does it say "GO_DEVICE"? Or does it say "G0_DEVICE" ?
It means at the point in the program the compiler barfed, it couldn't find anything called "GO_DEVICE0".
You fix it by defining something called "GO_DEVICE0".

Please use code tags when posting code, and give your keyboard a good shake - the '?' key is sticking.

Welcome to the Forum. We note that you have made several posts before, yet have not read the rules for posting to the Forum. The rules are explained in the first two posts at the top of the Forum list. It would help us if you followed those rules, as it makes it easier for us to help you. Always use code tags when posting source code.

Cross-posting merged

DO NOT CROSS-POST, IT WASTES TIME

@PaulS: Hmm, I'm not sure why it is. I'll try your suggestion tho. Thanks.

@AWOL: It says G zero, not G O. How do I "define" it? And sorry about the ???... I'll refrain from doing so if it annoys you.

@econjack: please don't take this the wrong way, but you are wrong on two points. I have not made several posts before, only 2. 1 was posted twice because I thought it could aptly pertain to two different areas of subjects. I thought the point of forums was to discuss for learning and otherwise, so naturally I thought that was ok. I see now it's not, so it will cease. Secondly, your claim that I didn't read the rules are false. I did. I am new to participating in forums so I was confused at a lot of the lingo that I seemed not to quite understand at first. Through the last few posts here by others I am now beginning to understanding what some of them mean. However, I still don't understand what code tags are. Sorry, I am also new to Arduino, code, programming, and electronics in general. I am trying to learn on all fronts. I'll adapt quick. Edit: I see now that I have in fact made 8 posts. My mistake, and apologies.

@AWOL again: I think I just explained my situation in being new to participating in forums. But I find it funny how you ask that I stop using multiple question marks yet you used all caps, bold enlarged letters, and underlined. Kinda hypocritical, don't you think?

No, I don't think it all hypocritical.
After all, I went to the extra effort of merging your two identical posts, deleting the colour tags, adding code tags and pointing out your problem.
I could have simply binned one of the threads.

But isn't that your job as moderator? Frankly, it's kind of redundant to have them both under the same area, as I intentionally put them in two areas on purpose, albeit unknowingly against the rules. You should have binned one and spared me the hypocrisy.

The reason for your first error with GO_DEVICE is this, what was declared in the enum was written as G0_DEVICE, it was a zero, not the capital letter O.

Second after that was fixed, the next two errors would have been digital**.**Write(8,LOW); <-Should not have a period and it was missing a semicolon. It should be digitalWrite(8,LOW);

Same goes for the one below that.

Fixed.

#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#include "Platform.h"
#include "SoftwareSerial.h"
#ifndef CDC_ENABLED
// Shield Jumper on SW
SoftwareSerial port(12,13);
#else
// Shield Jumper on HW (for Leonardo)
#define port Serial1
#endif
#else // Arduino 0022 - use modified NewSoftSerial
#include "WProgram.h"
#include "NewSoftSerial.h"
NewSoftSerial port(12,13);
#endif

#include "EasyVR.h"

EasyVR easyvr(port);

int LED = 8 ;

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

enum Group0 
{
  GO_DEVICE = 0, // fixed
};

enum Group1 
{
  G1_LED_ON = 0,
  G1_LED_OFF = 1,
};


EasyVRBridge bridge;

int8_t group, idx;

void setup()
{
#ifndef CDC_ENABLED
  // bridge mode?
  if (bridge.check())
  {
    cli();
    bridge.loop(0, 1, 12, 13);
  }
  // run normally
  Serial.begin(9600);
  Serial.println("Bridge not started!");
#else
  // bridge mode?
  if (bridge.check())
  {
    port.begin(9600);
    bridge.loop(port);
  }
  Serial.println("Bridge connection aborted!");
#endif
  port.begin(9600);

  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()
{
  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 GO_DEVICE:
      
        group = GROUP_1 ;

      // 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:
      digitalWrite(8,HIGH); // fixed
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
    case G1_LED_OFF:
      digitalWrite(8,LOW); //fixed
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      group = GROUP_0;
      delay(5);
    }
    break;
  }
}

But imagine if I'd binned the thread with the correct answer.

Common-sense (an ironically rare commodity, it seems) suggests that asking the same question in two different places on the same forum is going to attract the wrong kind of attention to your future posts.
"Ah! It's the time-waster again" they'll say "I don't think I'll bother replying to this one - someone's probably already answered it somewhere else"

MikeTate:
But isn't that your job as moderator?

I don't have a job as a moderator - I have a job as a software engineer.

@HazardsMind: Wow, awesome. Can't thank you enough. I really do appreciate it and thank you for taking time out of your day to help me. Edit: Just tested the code and it works perfectly. Thanks again HazardsMind!

@AWOL: Ok