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

Android Arduino LED Control Guide

This Arduino code controls an LED connected to pin 13 using Bluetooth communication from an Android device. The Arduino listens for serial input over Bluetooth and turns the LED on if it receives the string "on" or off if it receives "off". It initializes pin 13 as an output, begins serial communication at 9600 baud, and enters a loop to read incoming serial data, check for the strings "on" or "off", set the pin high or low accordingly, and clear the string variable.

Uploaded by

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

Android Arduino LED Control Guide

This Arduino code controls an LED connected to pin 13 using Bluetooth communication from an Android device. The Arduino listens for serial input over Bluetooth and turns the LED on if it receives the string "on" or off if it receives "off". It initializes pin 13 as an output, begins serial communication at 9600 baud, and enters a loop to read incoming serial data, check for the strings "on" or "off", set the pin high or low accordingly, and clear the string variable.

Uploaded by

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

How to Simulate Android Arduino LED Control Via Bluetooth in Proteus

String voice;
void setup() {
pinMode(13, OUTPUT);
[Link](9600);
}
void loop() {
while ([Link]())
{
delay(10);
char c = [Link]();
voice += c;
}
if ([Link]() > 0)
{
[Link](voice);
if(voice == "on")
{
digitalWrite(13, HIGH);
}
if(voice == "off")
{
digitalWrite(13, LOW);
}
voice="";
}
}

You might also like