The main implementation of this tutorial: control the LED through the Voice module on the light and out. Said "Turn on the Light", LED light, said "turn off the Light", led off.
LD3320 Speech Recognition Module Overview:
The use of SPI communication interface, onboard microphone and active crystal oscillator to facilitate the realization of the electronic products voice recognition, voice control and man-machine conversation functions.
Hardware preparation:
UNO PLUS
I/O expansion Shield
LD3320 Shield
Hardware connection:
1. Connect LD3320 Voice module
3.3V- - VCC
GND- - GND MISO-- D12
mosi - - D11 SCK--D13 NSS--D4 RST--D9 IRQ--D2 WR--GND
2. Will D8 Connect to the negative pole of the LED lamp and speak the LED positive pole connected to VCC.
Code:
#include <PinMap.h>
#include <ld3320.h>
voicerecognition Voice;
#define LED 8
void Setup ()
{
pinmode (led,output);
Voice.init ();
Voice.addcommand ("Kai Deng", 0);
Voice.addcommand ("Guan Deng", 1);
Voice.start ();
void Loop () {
switch (voice.read ())
{case
0:
digitalwrite (led,low);
break;
Case 1:
digitalwrite (Led,high);
break;
Default: Break
;
}
}
Program Download Link: Link: http://pan.baidu.com/s/1hqlJFI8 Password: w9ly