Hello,
I have a problem while connecting arduino UNO with the bluetooth module Xm-15b and the driver LN298.
I am making a 2 wheels robot controlled by bluetooth.
The problem is that when i am connected to the computer port ("COM4"), it works; but if i use the 9v battery instead of the computer, although everything turn on, the connection with my cellphone (using BluetoothSerialController.apk) doesnt work when i reconnect it to the module.
the code is the following:
int in1 = 7;
int in2 = 6;
int in3 = 5;
int in4 = 4;
void setup()
{
** Serial.begin(9600);**
** pinMode (in1,OUTPUT);**
** pinMode (in2,OUTPUT);**
** pinMode (in3,OUTPUT);**
** pinMode (in4,OUTPUT);**
}
void loop()
{
** if (Serial.available()>0)**
** {**
** char nodato = Serial.read();**
** char dato = char (nodato);**
** if (dato == '0')**
** {**
** digitalWrite (in1,LOW);**
** digitalWrite (in2,HIGH);**
** digitalWrite (in3,HIGH);**
** digitalWrite (in1,LOW);**
** }**
** if (dato == '1')**
** {**
** digitalWrite (in1,HIGH);**
** digitalWrite (in2,LOW);**
** digitalWrite (in3,HIGH);**
** digitalWrite (in1,LOW);**
** }**
** if (dato == '2')**
** {**
** digitalWrite (in1,HIGH);**
** digitalWrite (in2,LOW);**
** digitalWrite (in3,HIGH);**
** digitalWrite (in1,LOW);**
** }**
** if (dato == '3')**
** {**
** digitalWrite (in1,HIGH);**
** digitalWrite (in2,LOW);**
** digitalWrite (in3,LOW);**
** digitalWrite (in1,HIGH);**
** }**
** if (dato == '4')**
** {**
** digitalWrite (in1,LOW);**
** digitalWrite (in2,LOW);**
** digitalWrite (in3,LOW);**
** digitalWrite (in1,LOW);**
** }**
** }**
}
the connections are these:
xm-15b: