About *Arduino*Bluetooth Car
This is a very simple and easy application to control Arduino Bluetooth car ....
note- you need to build your own car using Arduino micro-controller it wont work with ordinary RC car.Watch the video before installing the application.
Wiring Setup-
motor drive input1----------digital pin 12 (Arduino)
motor drive input2----------digital pin 11 (Arduino)
motor drive input3----------digital pin 10 (Arduino)
motor drive input4----------digital pin 9 (Arduino)
Led-digtal---------------------pin 13 (Arduino)
Bluetooth Module pin Rx-----Digital pin Tx(Arduino)
Bluetooth Module pin Tx-----Digital pin Rx(Arduino)
Arduino Code-
int m1 = 12;
int m2 = 11;
int b1 = 10;
int b2 = 9;
int light= 13;
String readString;
void setup() {
Serial.begin(9600);
pinMode(m1, OUTPUT);
pinMode(m2, OUTPUT);
pinMode(b1, OUTPUT);
pinMode(b2, OUTPUT);
pinMode(light, OUTPUT);
}
void loop() {
while (Serial.available()) {
delay(3);
char c = Serial.read();
readString += c;
}
if (readString.length() >0) {
Serial.println(readString);
if (readString == "f")
{
digitalWrite(m1, HIGH);
digitalWrite(m2, HIGH);
}
if (readString == "b")
{
digitalWrite(b1, HIGH);
digitalWrite(b2, HIGH);
}
if (readString == "l")
{
digitalWrite(m1, HIGH);
digitalWrite(b2, HIGH);
}
if (readString == "r")
{
digitalWrite(m2, HIGH);
digitalWrite(b1, HIGH);
}
if (readString == "s")
{
digitalWrite(m1, LOW);
digitalWrite(m2, LOW);
digitalWrite(b1, LOW);
digitalWrite(b2, LOW);
}
if (readString == "ledon")
{
digitalWrite(light, HIGH);
}
if (readString == "ledoff")
{
digitalWrite(light, LOW);
}
readString="";
}
}
//Watch my other videos on- https://www.youtube.com/channel/UCvR-ssFhPXo2xO1A9JfzXyA
by S####:
Add speed control