Professional Documents
Culture Documents
Program For Arduino
Program For Arduino
void setup()
void loop()
if (c == '#'){
if (voice.length() >0)
Serial.println(voice);
switchon();
switchoff();
} //Initiate function switchoff if voice is switch off
//You can replace 'lamp on' with anything you want...same applies to others
digitalWrite(relay1, HIGH);
digitalWrite(relay1, LOW);
digitalWrite(relay2, HIGH);
digitalWrite(relay2, LOW);
voice="";
digitalWrite(relay1, HIGH);
digitalWrite(relay2, HIGH);
digitalWrite(relay1, LOW);
digitalWrite(relay2, LOW);
/*
You can add any function you want depending on how many devices you have hooked up.
For example you could have a function called 'cinema' which would dim the lights and
turn the TV on. You can have as many as you have pins on your arduino.
void ......()
digitalWrite(...., LOW/HIGH);
digitalWrite(...., LOW/HIGH);
*/