Easy VR + Arduino Uno

Bonjour a tous j'ai un projet, je doit programmer arduino et le shield easyvr afin d'alimenter une gâche électrique pour déverrouiller une porte, bien sur la sortie d'arduino est branché sur un transistor pour alimenter la gâche en 12V et non en 5V, j'ai réussi à tout faire sauf programmer arduino, j'ai configurer le shield grâce au logiciel easyvr commander.
Je veux simplement que lorsque le shield détecte ma commande vocale "OUVRIR" (pré-configurer sur easyvr commander) arduino alimente la sortie 3.

Le logiciel me donne un programme (avec les commandes pré-configurer) mais je ne sais pas comment dire qu'il faut alimenté la sortie 3 si on capte la commande ouvrir, si quelqu'un pourrait m'aider ça m'avancerai beaucoup.

Je joint le programme :

#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_1  = 1,
};

enum Group1 
{
 G1_OUVRIR = 0,
};


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_1:
     switch (idx)
     {
     case G1_OUVRIR:
       // write your action code here
       // group = GROUP_X; <-- or jump to another group X for composite commands
       break;
     }
     break;
   }
}

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

bonjour,
c'est pourtant marqué dans ton code

     case G1_OUVRIR:
[b]       // write your action code here[/b]
       // group = GROUP_X; <-- or jump to another group X for composite commands
       break;
     }

sans oublier la déclarations de la pin au début et dans le void setup le pinMode

infobarquee:
bonjour,
c'est pourtant marqué dans ton code

     case G1_OUVRIR:

       // write your action code here
       // group = GROUP_X; <-- or jump to another group X for composite commands
       break;
     }




sans oublier la déclarations de la pin au début et dans le void setup le pinMode

Donc je déclare que la "GACHE" est en sortie 3 et :

     case G1_OUVRIR:
[b]      digitalWrite(GACHE, HIGH); //Alimentation de la gâche
           delay(1000); //Temps pour ouvrir la porte (exemple)
           digitalWrite(GACHE, LOW); //Arrêt de l'alimentation de la gâche
       // group = GROUP_X; <-- or jump to another group X for composite commands
       break;
     }

Comme ceci ?

Oui et après tu lui dis de revenir au groupe 1 sinon ça va bugger :grin:

case G1_OUVRIR:
           digitalWrite(GACHE, HIGH); //Alimentation de la gâche
           delay(5000); //Temps pour ouvrir la porte (exemple)
           digitalWrite(GACHE, LOW); //Arrêt de l'alimentation de la gâche
       group = GROUP_1; <-- or jump to another group X for composite commands
       break;
     }