0% found this document useful (0 votes)
5 views1 page

Arduino Voice-Controlled Light System

The document contains an Arduino sketch that sets up a serial communication and controls an output pin based on voice commands. It listens for commands 'light on' and 'light off' to turn an LED connected to pin 13 on and off, respectively. The sketch initializes the serial communication at 9600 baud rate and continuously checks for available serial input in the loop function.

Uploaded by

Deepak Malik
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Arduino Voice-Controlled Light System

The document contains an Arduino sketch that sets up a serial communication and controls an output pin based on voice commands. It listens for commands 'light on' and 'light off' to turn an LED connected to pin 13 on and off, respectively. The sketch initializes the serial communication at 9600 baud rate and continuously checks for available serial input in the loop function.

Uploaded by

Deepak Malik
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

int L1 = 13;

void setup() {
[Link](9600);
pinMode(L1,OUTPUT);
}

char c;
String voice;

void loop() {
if ([Link]()>0)
{
voice="";
voice=[Link]();
[Link](voice+'\n');
}

if(voice=="light on")
{
digitalWrite(L1,HIGH);
} else if(voice=="light off")
{
digitalWrite(L1,LOW);
}
}

You might also like