hirushanirmalsk
Published © SHL

Bluetooth controlled car

This is a robot car.it was created by hirusha with arduino++. it is a my first car project.

BeginnerProtip1,070
Bluetooth controlled car

Things used in this project

Hardware components

Arduino UNO Wifi Rev.2
Arduino UNO Wifi Rev.2
×1
Development Board, Motor Control Shield
Development Board, Motor Control Shield
×1
Maker Essentials - Micro-motors & Grippy Wheels
Pimoroni Maker Essentials - Micro-motors & Grippy Wheels
×4
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Li-Ion Battery 1000mAh
Li-Ion Battery 1000mAh
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Code

RANGER.ino

Arduino
#include <AFMotor.h>//made by hirusha nirmal
AF_DCMotor R2(1);
AF_DCMotor R1(2);
AF_DCMotor L2(3);
AF_DCMotor L1 (4);

char bt='s';
void setup() {
  Serial.begin(9600);

R1.setSpeed(255);
R2.setSpeed(255);
L1.setSpeed(255);
L2.setSpeed(255);
Stop();

}

void loop() {
 bt=Serial.read();

 if (bt=='F')
 {
  forward();
 }

 if (bt=='B')
 {
  backward();
 }

 if (bt=='R')
 {
  right();
 }

 if  (bt=='L')
 {
  left();
 }

 if (bt=='S')
 {
  Stop();
 }
 }
void forward()
{
  R1.run(FORWARD);
  R2.run(FORWARD);
  L1.run(FORWARD);
  L2.run(FORWARD);
}

void backward()
{
  R1.run(BACKWARD);
  R2.run(BACKWARD);
  L1.run(BACKWARD);
  L2.run(BACKWARD); 
}

void right()
{
  R1.run(BACKWARD);
  R2.run(BACKWARD);
  L1.run(FORWARD);
  L2.run(FORWARD); 
}

 void left()
 {
  R1.run(FORWARD);
  R2.run(FORWARD);
  L1.run(BACKWARD);
  L2.run(BACKWARD); 
}

void Stop()
{
  R1.run(RELEASE);
  R2.run(RELEASE);
  L1.run(RELEASE);
  L2.run(RELEASE); 
}//made by hirusha nirmall

Credits

hirushanirmalsk
0 projects • 2 followers

Comments