by J.B. Wylzan
VOICE RECOGNITION APP |
Arduino Sketch:
/* ===============================================================
Project: VOICE CONTROL HOME AUTOMATION
Author: J. B. Wylzan
Website: http://www.ihackrobot.blogspot.com
Abstract: How to control an led using SPEECH or VOICE
================================================================== */
#include <SoftwareSerial.h>
SoftwareSerial BTserial(2, 3); // RX | TX
int ledPin = 12;
String vox;
int x=10;
int var=0;
void setup()
{
pinMode(ledPin, OUTPUT);
BTserial.begin(9600);
// Serial.begin(9600);
// BTserial.println("Speech Recognition");
}
void loop()
{
while (BTserial.available())
{
delay(x);
char c = BTserial.read();
vox += c;
}
if (vox.length() > 0) {
if(vox== "on")
{
digitalWrite(ledPin , HIGH);
}
if(vox== "off")
{
digitalWrite(ledPin , LOW);
}
vox=""; //Reset the variable
}
}
MIT Modules:
MIT APP INVENTOR 2 BLOCKS |
MIT APP INVENTOR 2 SIMULATOR |
Warning: : If an application is requesting permission to access any information of your phone or tablet, it is your sole own discretion if you provide permission or not. IHackRobot is not affiliated with the contents of the application or even its owner.
Disclaimer: We shall not be liable for any loss or damage of whatever nature - direct, indirect, consequential, or otherwise - which may arise as a result of your use of any information on this website. However, if you are interested in using any of the projects for personal or educational purposes, please inform the author by email.
Public Domain Notice: Copyright (c) 2000. All rights reserved. This article is part of a book entitled iHackRobot. Copies are welcome to be shared or distributed publicly as long proper citations are observed. Please cite as follows: Biotronics: The Silver Species, Joey Lawsin, 1988, USA.
==================================================================
Patent Pending. 2000 © ®
A L.A.W.S.I.N. Educational Production