Speech Module LD3320 Control LED Light _ hardware

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.