17Views0Replies

Author Options:

My arduino bluetooth car is not working, how can i fix it? Answered

I have made bluetooth car using arduino but im having a problem using bluetooth serial how can i fix it here are the code that i have written #include AF_DCMotor motor1(1,MOTOR12_64KHZ);//running motor on full speed of 64Khz AF_DCMotor motor2(2,MOTOR12_64KHZ); int led = 13; void setup() { //Put your setup code here, to run once: Serial.begin(9600); motor1.setSpeed(255);// default speed motor2.setSpeed(255); pinMode(led,OUTPUT); } void loop() { //Put your main code here, to run repeatedly: if(Serial.available()>0) { int incoming=Serial.read(); if(incoming=='f'){ motor1.run(FORWARD); } if(incoming=='b'){ motor1.run(BACKWARD); } if(incoming=='l'){ motor2.run(FORWARD); } if(incoming=='r'){ motor2.run(BACKWARD); } if(incoming=='o'){ digitalWrite(led,HIGH); } if(incoming=='c'){ digitalWrite(led,LOW); } } }

Discussions