حسن الجزائري
Published

Bluetooth Controlled DC Motor & LED

Control DC motor & LED by Bluetooth through MobilePhone

Showcase (no instructions)835
Bluetooth Controlled DC Motor & LED

Things used in this project

Code

Code of Project

C/C++
char Blutoothdata; 
void setup() {
Serial.begin(9600);  
pinMode(11,OUTPUT);
pinMode(10,OUTPUT);
pinMode(9,OUTPUT);
Blutoothdata='N';}
void loop() {
if(Serial.available()){
  Blutoothdata=Serial.read();}
while(Blutoothdata=='A'){
  digitalWrite(11,HIGH);
  digitalWrite(10,LOW);
  digitalWrite(9,HIGH);
if(Serial.available()){
  Blutoothdata=Serial.read();}
  Serial.print(Blutoothdata);}
while(Blutoothdata=='B'){
  digitalWrite(11,LOW);
  digitalWrite(10,HIGH);
  digitalWrite(9,HIGH);
if(Serial.available()){
  Blutoothdata=Serial.read();}
  Serial.print(Blutoothdata);}
while(Blutoothdata=='C'){
  digitalWrite(11,LOW);
  digitalWrite(10,LOW);
  digitalWrite(9,LOW);
if(Serial.available()){
  Blutoothdata=Serial.read();}
  Serial.print(Blutoothdata);}}

Credits

حسن الجزائري

حسن الجزائري

1 project • 0 followers
Student 4th Stage in Electrical Engineering at University of Kufa

Comments