Go Down

Topic: Voice controlled RC car (Read 67 times) previous topic - next topic

Hello Guys,
               I am new to arduino... I wante dto make a voice controlled RC car using arduino.... I followed tutorial on the internet,.... According to the tutorial i desoldered the RX-2B IC from RC car and soldered wires on the pins 2,6,7,10,11... I connected the Pin 2 to GND on the arduino , Pin 6 to Pin 9 on the arduino, Pin 7 to Pin 10 on the arduino and Pin 10 to Pin 11 on the arduino and Pin 11 to Pin 12 on the arduino..... I use a HC-06 bluetooth module to connect the arduino to my android phone.... I connected the VCC to +5V on the Arduino, Tx-->RX and RX-->TX and GND to GND on the power section of the arduino.... I use this app to send commands https://play.google.com/store/apps/details?id=robotspace.simplelabs.amr_voice&hl=en



Here is my code:


#include<SoftwareSerial.h>
SoftwareSerial BT(1,0); //RX,TX
String readvoice; // To read data from Android


void setup()
{
  BT.begin(9600);
  Serial.begin(9600);
  pinMode(9,OUTPUT);
  pinMode(10,OUTPUT);
  pinMode(11,OUTPUT);
  pinMode(12,OUTPUT);

}

//--------------------------------------------------------------//

void loop ()
{
  while(BT.available()) //To check if there is any data from HC-05 BM
   { delay(10); //Delay to avoid unstable data reads
    char c=BT.read(); // To read
    readvoice +=c; // To make strings
  }
 
  if(readvoice.length()>0)
  {
    Serial.println(readvoice);
   
    if(readvoice=="*forward#")
    {
      digitalWrite(9,HIGH);
      digitalWrite(10,LOW);
      digitalWrite(11,LOW);
      digitalWrite(12,LOW);
      delay(7000);
      digitalWrite(9,LOW);
      digitalWrite(10,LOW);
      digitalWrite(11,LOW);
      digitalWrite(12,LOW);
    }
   
    else if(readvoice=="*backward#")
    {
      digitalWrite(9,LOW);
      digitalWrite(10,HIGH);
      digitalWrite(11,LOW);
      digitalWrite(12,LOW);
      delay(3000);
      digitalWrite(9,LOW);
      digitalWrite(10,LOW);
      digitalWrite(11,LOW);
      digitalWrite(12,LOW);
    }
   
    else if(readvoice=="*forward left turn#")
    {
      digitalWrite(9,HIGH);
      digitalWrite(10,LOW);
      digitalWrite(11,HIGH);
      digitalWrite(12,LOW);
      delay(5000);
      digitalWrite(9,LOW);
      digitalWrite(10,LOW);
      digitalWrite(11,LOW);
      digitalWrite(12,LOW);
    }
   
    else if(readvoice=="*forward right turn#")
    {
      digitalWrite(9,HIGH);
      digitalWrite(10,LOW);
      digitalWrite(11,LOW);
      digitalWrite(12,HIGH);
      delay(3000);
      digitalWrite(9,LOW);
      digitalWrite(10,LOW);
      digitalWrite(11,LOW);
      digitalWrite(12,LOW);
    }
   
    else if(readvoice=="*reverse left turn#")
    {
      digitalWrite(9,LOW);
      digitalWrite(10,HIGH);
      digitalWrite(11,HIGH);
      digitalWrite(12,LOW);
      delay(5000);
      digitalWrite(9,LOW);
      digitalWrite(10,LOW);
      digitalWrite(11,LOW);
      digitalWrite(12,LOW);
    }
   
    else if(readvoice=="*reverse right turn")
    {
      digitalWrite(9,LOW);
      digitalWrite(10,HIGH);
      digitalWrite(11,LOW);
      digitalWrite(12,HIGH);
      delay(5000);
      digitalWrite(9,LOW);
      digitalWrite(10,LOW);
      digitalWrite(11,LOW);
      digitalWrite(12,LOW);
     
    }
   
    else if(readvoice=="*stop#")
    {
      digitalWrite(9,LOW);
      digitalWrite(10,LOW);
      digitalWrite(11,LOW);
      digitalWrite(12,LOW);
    }
  }
}





I can connect to the HC-06 send commands but nothing seems to work..>! PLs help... How do I know if the bluetooth module is receiving data correctly from the app...>?

P.S: I included the '*' at the beginning of the each command and '#' at the end of each command bcos it was said to do so by the developer....!


Pls help....
 I just got 2 more days to submit my project...

AWOL

Your other two equally badly posted questions have been deleted.

DO NOT CROSS-POST, CROSS-POSTING WASTES TIME.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

@Awol im new to the forum,... I ll nt do it in future.... You got any solutions for my problem,..>??

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy