SMART PHONE CONTROLLED CAR 77uhn

TLROB003

Shruti wanted to gift a remote control car to her brother on his birth day. Instead of remote she thought to make a car that can be controlled by cell phone. Can you help her to make a mobile controlled car?
Robo Car chassis Kit
  1. Attach 2 motors and caster wheel to the chassis.
  2. Create a system of motor driver IC, bluetooth sensor and arduino UNO.
  3. Code on arduino IDE. (for connection and code take help of let's tinker app)
  4. Install app Arduino Bluetooth from play store.
  5. Map the button values with app.

    

#define ledPin 7

int rm1 =2;

int rm2 =3;

int lm1 =4;

int lm2 =5;

int enr=9;

int enl=10;

int state = 0;

void setup() {

pinMode(ledPin, OUTPUT);

digitalWrite(ledPin, LOW);

Serial.begin(38400); 

}

void loop() {

if(Serial.available() > 0){ 

state = Serial.read(); 

 if (state == '0') {

digitalWrite(ledPin, LOW); 

Serial.println("LED: OFF");

state = 0;

 }

 else if (state == '1') {

digitalWrite(ledPin, HIGH);

Serial.println("LED: ON");;

state = 0;

 } 

}

}

void forward() {

digitalWrite(rm1,1);

digitalWrite(rm2,0);

digitalWrite(lm1,1);

digitalWrite(lm2,0);

}

void backward(){

digitalWrite(rm1,0);

digitalWrite(rm2,1);

digitalWrite(lm1,0);

digitalWrite(lm2,1);

}

void clockwise(){

digitalWrite(rm1,0);

digitalWrite(rm2,1);

digitalWrite(lm1,1);

digitalWrite(lm2,0);

}

void cclockwise(){

digitalWrite(rm1,1);

digitalWrite(rm2,0);

digitalWrite(lm1,0);

digitalWrite(lm2,1);

}

void stops(){

digitalWrite(rm1,0);

digitalWrite(rm2,0);

digitalWrite(lm1,0);

digitalWrite(lm2,0);

}