Devices & Components
Arduino Uno Rev3
HC-05 Bluetooth Module
Android device
LED (generic)
Breadboard (generic)
Software & Tools
LED Controller
Arduino IDE
Project description
Code
Code
c_cpp
1char data = 0; //Variable for storing received data 2void setup() 3{ 4 Serial.begin(9600); //Sets the baud for serial data transmission 5 pinMode(13, OUTPUT); //Sets digital pin 13 as output pin 6} 7void loop() 8{ 9 if(Serial.available() > 0) // Send data only when you receive data: 10 { 11 data = Serial.read(); //Read the incoming data & store into data 12 Serial.print(data); //Print Value inside data in Serial monitor 13 Serial.print("\ 14"); 15 if(data == '1') // Checks whether value of data is equal to 1 16 digitalWrite(13, HIGH); //If value is 1 then LED turns ON 17 else if(data == '0') // Checks whether value of data is equal to 0 18 digitalWrite(13, LOW); //If value is 0 then LED turns OFF 19 } 20} 21
Downloadable files
Circuit Diagram
Make connections according to diagram
Circuit Diagram
Circuit Diagram
Make connections according to diagram
Circuit Diagram
Comments
Only logged in users can leave comments