jehankandt
Published

Arduino Bluetooth Car with Lib

Basic of Arduino RC Bluetooth Car with my own library Bluetooth_car. h

ExpertFull instructions provided2,326
Arduino Bluetooth Car with Lib

Things used in this project

Story

Read more

Schematics

Arduino RC Bluetooth car

Arduino RC Bluetooth car

Code

Arduino RC Bluetooth car

C/C++
Arduino RC Bluetooth car
/* 
 *  this is basic of Arduino RC Robot
     
 *    
 */


#include <Bluetooth_car.h> // call library that we create before
int val;

//pin in L2985 Motor Contral
int in1 = 5; //in1
int in2 = 6; //in2
int in3 = 7; //in3
int in4 = 8; //in4

//difine pins

Bluetooth_car RC_car(in1,in2,in3,in4);

void setup() {
  RC_car.PinSetup();
  Serial.begin(9600);
}

void loop() {
  if(Serial.available()){
    val = Serial.read();
  }

  if(val == '1'){
    RC_car.forward_rc(); // forward
  }
  else if(val == '2'){
    RC_car.backward_rc();// backward
  }
  else if(val == '3'){
    RC_car.left_rc();// left
  }
  else if(val == '4'){
    RC_car.right_rc();// right
  }
  else if(val == '5'){
    RC_car.stop_rc();// stop
  }
}

Credits

jehankandt

jehankandt

21 projects • 8 followers

Comments