Go Down

Topic: Program Speech recognition +  Light  Control (Read 1 time) previous topic - next topic

sodanum

Apr 16, 2010, 09:00 pm Last Edit: Apr 16, 2010, 11:18 pm by sodanum Reason: 1

Hello..... ;D

"Sa wat Dee"



I come form thailand

My English is not good   :P

This is  my project


[size=14]Computer => Arduino  => Relay  => Lighting Control[/size]


Program
Voice Flux Pro = Program  Speech recognition
http://nitrous-voice-flux.en.softonic.com/

Hardware
- Freeduino
- Relay shield
- light bulb
- computer



Vdo

[media]http://www.youtube.com/watch?v=OeDBsk5_yEc&feature=player_embedded[/media]


Freeduino + Relay shield

http://i978.photobucket.com/albums/ae268/sodanum_photo/100_2903.jpg


more detail (Thai language)

http://www.electoday.com/bbs/viewthread.php?tid=5210



Arduino
Code: [Select]

// Relay digital pin 7,4
int relayOne = 4;
int relayTwo = 7;

void setup()   {   

  Serial.begin(9600);
  pinMode(relayOne, OUTPUT);  
  pinMode(relayTwo, OUTPUT);   
  
}

void loop()                     
{
  
  char c;
  
  if (Serial.available())
  {
    c = Serial.read();
    if(c == 'a'){digitalWrite(relayOne, HIGH);}
    if(c == 's'){digitalWrite(relayOne, LOW);}
   
    if(c == 'z'){digitalWrite(relayTwo, HIGH);}
    if(c == 'x'){digitalWrite(relayTwo, LOW);}
   }
  
}



Processing
Code: [Select]

import processing.serial.*;

Serial myPort;  
      

void setup()
{

  String portName = Serial.list()[0];
  myPort = new Serial(this, portName, 9600);
}

void draw() {
  background(255);
  if(keyPressed) {
     if(key >= 'A' && key <= 'z') {
       if(key == 'a') myPort.write('a');            
       if(key == 's') myPort.write('s');           
     }
  }
      
}

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy