Error DE compilacion

hola que tal amigos tengo problemas al compilar en el programa de arduino !!
me da los siguientes errores :
ProyectoFinal.pde: In function ‘void setup()’:
ProyectoFinal:103: error: a function-definition is not allowed here before ‘{’ token
ProyectoFinal:320: error: expected `}’ at end of input

les agradeceria su ayuda soy nuevo en esto y no se porque me da el error
aqui les dejo el codigo !

les agradecere su ayuda graciaaas!

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

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

enum Group0
{
G0_ENCENDER = 0,
};

enum Group1
{
G1_PORTON = 0,
G1_GARAGE = 1,
G1_SALA = 2,
G1_ESTUDIO = 3,
G1_COMEDOR = 4,
G1_GRADAS = 5,
G1_LAVANDERIA = 6,
G1_BANO = 7,
G1_COCINA = 8,
G1_JARDIN = 9,
G1_DORMITORIO1 = 10,
G1_DORMITORIO2 = 11,
G1_DORMITORIO3 = 12,
G1_BANO1 = 13,
G1_BANO2 = 14,
G1_SALON = 15,
};

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

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

for(int i=2; i<=3; i++){
pinMode(i, OUTPUT);

}

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 G0_ENCENDER:
// write your action code here
group = GROUP_1;
break;
}
break;
case GROUP_1:
switch (idx)
{
case G1_PORTON:
if(digitalRead(2) == LOW){
digitalWrite(2, HIGH);
}
else{
digitalWrite(2, LOW);
}
group = GROUP_0;
break;
case G1_GARAGE:
if(digitalRead(3) == LOW){
digitalWrite(3, HIGH);
}
else{
digitalWrite(3, LOW);
}
group = GROUP_0;
break;
case G1_SALA:
if(digitalRead(4) == LOW){
digitalWrite(4, HIGH);
}
else{
digitalWrite(4, LOW);
}
group = GROUP_0;
break;
case G1_ESTUDIO:
if(digitalRead(5) == LOW){
digitalWrite(5, HIGH);
}
else{
digitalWrite(5, LOW);
}
group = GROUP_0;
break;
case G1_COMEDOR:
if(digitalRead(6) == LOW){
digitalWrite(6, HIGH);
}
else{
digitalWrite(6, LOW);
}
group = GROUP_0;
break;
case G1_GRADAS:
if(digitalRead(7) == LOW){
digitalWrite(7, HIGH);
}
else{
digitalWrite(7, LOW);
}
group = GROUP_0;
break;
case G1_LAVANDERIA:
if(digitalRead(8) == LOW){
digitalWrite(8, HIGH);
}
else{
digitalWrite(8, LOW);
}
group = GROUP_0;
break;
case G1_BANO:
if(digitalRead(9) == LOW){
digitalWrite(9, HIGH);
}
else{
digitalWrite(9, LOW);
}
group = GROUP_0;
break;
case G1_COCINA:
if(digitalRead(10) == LOW){
digitalWrite(10, HIGH);
}
else{
digitalWrite(10, LOW);
}
group = GROUP_0;
break;
case G1_JARDIN:
if(digitalRead(11) == LOW){
digitalWrite(11, HIGH);
}
else{
digitalWrite(11, LOW);
}
group = GROUP_0;
break;
case G1_DORMITORIO1:
if(digitalRead(12) == LOW){
digitalWrite(12, HIGH);
}
else{
digitalWrite(12, LOW);
}
group = GROUP_0;
break;
case G1_DORMITORIO2:
if(digitalRead(13) == LOW){
digitalWrite(13, HIGH);
}
else{
digitalWrite(13, LOW);
}
group = GROUP_0;
break;
case G1_DORMITORIO3:
if(digitalRead(14) == LOW){
digitalWrite(14, HIGH);
}
else{
digitalWrite(14, LOW);
}
group = GROUP_0;
break;
case G1_BANO1:
if(digitalRead(15) == LOW){
digitalWrite(15, HIGH);
}
else{
digitalWrite(15, LOW);
}
group = GROUP_0;
break;
case G1_BANO2:
if(digitalRead(16) == LOW){
digitalWrite(16, HIGH);
}
else{
digitalWrite(16, LOW);
}
group = GROUP_0;
break;
case G1_SALON:
if(digitalRead(17) == LOW){
digitalWrite(17, HIGH);
}
else{
digitalWrite(17, LOW);
}
group = GROUP_0;
break;
}
break;
}
}
[/table]