Presentation is loading. Please wait.

Presentation is loading. Please wait.

PROGRAMMING LANGUAGE CEM AYGUN 2010514008 VOICE CONTROLLED LED LIGHT.

Similar presentations


Presentation on theme: "PROGRAMMING LANGUAGE CEM AYGUN 2010514008 VOICE CONTROLLED LED LIGHT."— Presentation transcript:

1 PROGRAMMING LANGUAGE CEM AYGUN 2010514008 VOICE CONTROLLED LED LIGHT

2  The aim of this project is changing the led state by means of voice.I used red,white and yellow leds. PURPOSE

3  My codes consist of two main parts which are serial port and speech recognition.I used serial port to provide communication between C# and MSP430 CODES

4 comboBox1.DataSource = SerialPort.GetPortNames(); serialPort1.PortName = comboBox1.Text; serialPort1.Open(); serialPort1.BaudRate = 9600; textBox2.Text=Convert.ToString(serialPort1.BaudRate); serialPort1.Close(); SERIAL PORT USING

5 1)The language of your computer should be English or any supported language. 2)Your microphone should function properly 3)If you want to switch your camputer language as English.You can download Vistalizator from http://www.froggie.sk/ 4)Adding libraries and namespaces: -System.Speech; - using System.Speech.Synthesis; -using System.Speech.Recognition; REQUIREMENTS TO USE SPEECH FEATURE

6 GLOBAL VARIABLES: SpeechRecognitionEngine speechrecognizer=new SpeechRecognitionEngine(new System.Globalization.CultureInfo("en-US")); SpeechSynthesizer voice = new SpeechSynthesizer(); LOAD GRAMMAR METHOD: Choices choices = new Choices(); choices.Add("red", "white", "white off", "yellow", "cem", "aygun", "red off", "yellow off"); GrammarBuilder grammarBuilder = new GrammarBuilder(choices); Grammar grammar = new Grammar(grammarBuilder); speechrecognizer.LoadGrammar(grammar); SPEECH CLASS

7

8 speechrecognizer.SpeechDetected += new EventHandler (sestaniniyor); speechrecognizer.SpeechRecognitionRejected += new EventHandler (sestanimlanamadi); speechrecognizer.SpeechRecognized += new EventHandler (sestanindi); speechrecognizer.SetInputToDefaultAudioDevice(); speechrecognizer.RecognizeAsync(RecognizeMode.Single); CONTINUE

9 private void sestanindi(object sender, SpeechRecognizedEventArgs tanima) { if (tanima.Result.Text == "yellow") { panel3.Visible = true; panel3.BackColor =Color.Yellow; serialPort1.Write("Y"); voice.Speak("yellow turns on"); } CONTINUE if (tanima.Result.Text == "yellow off") { panel3.Visible = false; serialPort1.Write("y"); voice.Speak("yellow turns off"); }

10 private void sestanimlanamadi(object sender, SpeechRecognitionRejectedEventArgs e) { textBox1.Text = "Ses Tanima İslemi Basarisiz. "; } CONTINUE

11 -http://msdn.microsoft.com/en- us/library/office/hh361683(v=office.14).aspx -www.georgehk.blogspot.com.tr/2014/05/turn-onoff-led-in- ardiuno-using-visual.html -http://www.burakozkan.net/c-serial-port-bileseni/ REFERANCES

12 ANY QUESTIONS??

13 THANK YOU FOR LISTENING!


Download ppt "PROGRAMMING LANGUAGE CEM AYGUN 2010514008 VOICE CONTROLLED LED LIGHT."

Similar presentations


Ads by Google