Pages: [1]   Go Down
Author Topic: Program Speech recognition +  Light  Control  (Read 1595 times)
0 Members and 1 Guest are viewing this topic.
Thailand
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Hello..... ;D

"Sa wat Dee"



I come form thailand

My English is not good   smiley-razz

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:
// 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:
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');           
     }
  }
      
}
« Last Edit: April 16, 2010, 04:18:59 pm by sodanum » Logged

Pages: [1]   Go Up
Jump to: