RC Bluetcar

by LeoMartinsTSk8 in Workshop > Electric Vehicles

1100 Views, 14 Favorites, 0 Comments

RC Bluetcar

14218528_1093687914002171_1060673914_n.jpg

A car made with Arduino controlled by ios or android ..
In this case controlled by IOS.

Necessary Materials

14284851_1093687924002170_119578321_o.jpg

1- Arduíno

1- Chip L293D

2- Leds ( any color )

1-Buzzer

1-HM-10 ( bluetooth module )

Jumpers.

Performing the Links

14215548_1093687917335504_2003035263_o.jpg
14269896_1094380200599609_698088925_n.jpg

After Connecting Pins, Find a Frame (chassis)

14284944_1093687920668837_1180589710_o.jpg
14218528_1093687914002171_1060673914_n.jpg

What can be done:
- Cardboard

-Acrylic

- Used Rc Cars ..

And what I prefer.

Choose the App to Control the Project

illu_what_is-board.png

Choose the app is important because, as the app is coming from the code, and what commands it sends to the project receive and play the code ..
I recommend App's I used in the project as the LOFI ROBOT (IOS). Providing the code, and the app get a good connection with the Bluetooth (HM-10). However can use the app you prefer, it is only a recommendation LOFI , I realized the project with him and it was quiet ..

CODE !

apple-touch-icon-precomposed.png

If you use the lofi app, the code has been modified to be used in this Project or use original code this available in

http://www.lofirobot.com/

All credits to the robot lofi app, I am using to represent only show the operation of the project that used the LOFI ROBOT app.

int val = 0;
int horizontal = 50;
int vertical = 50;
int A_state = 0;
int B_state = 0;
char data[5];
int m1;
int m2;
void setup()
{
  // silnik M1
 
pinMode(2, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(3, OUTPUT);
  // silnik M2
  pinMode(8, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(5, OUTPUT);
  //buzzer
  pinMode(13, OUTPUT);
  // diody LED
 
pinMode(10, OUTPUT);
  pinMode(9, OUTPUT);
  Serial.begin(9600); // komunikacja Arduino->Komputer przez kabel USB
 
Serial.begin(9600); // komunikacja Arduino->HM-10 bluetooth
   
motor1(1,225 );
  motor2(1, 225);
}
void loop()
{
  if (Serial.available())
  {
    Serial.readBytes(data, 5); // odbior danych z aplikacji
    horizontal = int(data[1]); 
// joystick os pozioma
    
vertical = int(data[2]); // joystick os pionowa
  
  A_state = int(data[3]); 
// lewy przycisk
 
   B_state = int(data[4]); // prawy przycisk
horizontal = horizontal * 2 - 100;
   
vertical = vertical * 2 - 100;
    Serial.print("horizontal = ");
 
   Serial.print(horizontal);
  
  Serial.print(" vertical = ");
 
   Serial.print(vertical);
 
   Serial.print(" A = ");
    Serial.print(A_state);
  
  Serial.print(" B = ");
 
   Serial.println(B_state);
  }
  digitalWrite(13, A_state);
  digitalWrite(10, B_state);
  digitalWrite(9, B_state);
 

m1 = vertical - horizontal;

m2 = vertical + horizontal;

int mm1 = min(255, 2.7 * abs(horizontal ));

int mm2 = min(255, 2.7 * abs(vertical));

  if (m1 > 0)
    motor1(true, mm1);
  else
    motor1(false, mm1);
  if (m2 > 0)
    motor2(true, mm2);
  else
    motor2(false, mm2);
}
void motor1(boolean direction, int power)
{
  digitalWrite(2, direction);
  digitalWrite(4, !direction);
  analogWrite(3,power );
}
// funkcja sterująca silnikiem podłączonym do gniazda M2
void motor2(boolean direction, int power)
{
  digitalWrite(7, direction);
  digitalWrite(8, !direction);
  analogWrite(5,power );
}