Skip to content

Commit 5f62d89

Browse files
committed
finished
1 parent 326ed5b commit 5f62d89

File tree

1 file changed

+28
-1
lines changed
  • content/hardware/04.pro/shields/portenta-vision-shield/tutorials/speech-recognition-engine

1 file changed

+28
-1
lines changed

content/hardware/04.pro/shields/portenta-vision-shield/tutorials/speech-recognition-engine/content.md

+28-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,34 @@ void VRCallback(int nFlag, int nID, int nScore, int nSG, int nEnergy)
313313
}
314314
```
315315
We added a `switch...case` that evaluates the `nID` variable and compares it with the different IDs.
316-
Inside each case add your custom code.
316+
Inside each case add your custom code to be executed with the trigger or commands.
317+
318+
```arduino
319+
...
320+
switch(nID)
321+
{
322+
case 100:
323+
Serial.println("The Trigger was heard");
324+
// Add your own code here
325+
break;
326+
case 10000:
327+
Serial.println("The Command -read- was heard");
328+
// Add your own code here
329+
break;
330+
case 10001:
331+
Serial.println("The Command -upload- was heard");
332+
// Add your own code here
333+
break;
334+
case 10002:
335+
Serial.println("The Command -share- was heard");
336+
// Add your own code here
337+
break;
338+
default:
339+
break;
340+
}
341+
...
342+
343+
```
317344

318345

319346
#### Unlock Limitations (License)

0 commit comments

Comments
 (0)