Hello, I have problem with my project. I build robot with 2DC motor, arduino uno and shield and BT module.
When I connect with the phone to BT robot and send commands to the Arduino controller, engines do not respond.
However, when I use a simple command engine management, they work.
I have been using the software RocketBOT phone (Samsung S3).
Meybe the error is in program code?
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
if(mySerial.available()>1)
{
qualifier=mySerial.read();
to do?
I can't see how you would ever be able to read "qualifier"
I understand that, that's why I asked what are you sending from the android and what are you receiving? I'm assuming you have an android phone, am I correct, or is it an IPhone?
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
if(mySerial.available()>1)
{
to do?
I use Arduino UNO R3, UNO have only one serial. Because, i connect to the board BT module, I need one more serial.
This command checks the BT connection.Would I be wrong?
I asked you to explain what you were doing, not how you were doing it.
The number of serial interfaces is immaterial; I don't see how you could ever get anything into "qualifier"
I understand that, that's why I asked what are you sending from the android and what are you receiving? I'm assuming you have an android phone, am I correct, or is it an IPhone?
I use RocketBOT program, and Samsung galaxy S3 smartphone.
Arduino and android connect. But i dont have data to RocketBot.
I understand that, that's why I asked what are you sending from the android and what are you receiving? I'm assuming you have an android phone, am I correct, or is it an IPhone?
I fix some problem, BT connect to the smartphone. When i press "forward" i have receive data:
qualifier = 68
dataByte = 1
But robot dont go forward.
First: For right now, get rid of everything, but if (mySerial.available())
** Serial.write(mySerial.read());** and see what do you get from the phone. You wont be able to do anything correctly, if you don't know what your getting.
Second:
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
if(mySerial.available()>1)
{
This does NOT connect the BT module to the phone. This just checks to see if there is any data available to be read.
I fix some problem, BT connect to the smartphone. When i press "forward" i have receive data:
qualifier = 68
dataByte = 1
But robot dont go forward.
Ok great, now you have something to show. So now my question is how are the servos powered?
if (mySerial.available()) // is there something to read?
Serial.write(mySerial.read()); // yes, so read it. It is no longer available to read.
if (Serial.available())
mySerial.write(Serial.read());
if(mySerial.available()>1) // a few microseconds later: is there anything to read? given that it takes over a millisecond to send a character at
9660, it doesn't seem likely.
{
qualifier=mySerial.read();
Why don't you read the character into a variable BEFORE echoing it?
HazardsMind:
First: For right now, get rid of everything, but if (mySerial.available())
** Serial.write(mySerial.read());** and see what do you get from the phone. You wont be able to do anything correctly, if you don't know what your getting.
Second:
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
if(mySerial.available()>1)
{
This does NOT connect the BT module to the phone. This just checks to see if there is any data available to be read.
I change it, now connect ok, and send data to the device. But robot dont go.
Maybe can solve this problem?
HazardsMind:
First: For right now, get rid of everything, but if (mySerial.available())
** Serial.write(mySerial.read());** and see what do you get from the phone. You wont be able to do anything correctly, if you don't know what your getting.
Second:
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
if(mySerial.available()>1)
{
This does NOT connect the BT module to the phone. This just checks to see if there is any data available to be read.
I fix some problem, BT connect to the smartphone. When i press "forward" i have receive data:
qualifier = 68
dataByte = 1
But robot dont go forward.
Ok great, now you have something to show. So now my question is how are the servos powered?
I use the battery is 9V. It is powered by two motors and bt module. Maybe I need more power?
I use the battery is 9V. It is powered by two motors and bt module. Maybe I need more power?
9 Volt batteries are horrible for an Arduino project. Also please tell me you are not putting 9V directly into the BT module and servos, the Arduino is fine, it can handle 9V, but not the BT and servos.
I use the battery is 9V. It is powered by two motors and bt module. Maybe I need more power?
9 Volt batteries are horrible for an Arduino project. Also please tell me you are not putting 9V directly into the BT module and servos, the Arduino is fine, it can handle 9V, but not the BT and servos.
Everything seems to be about as
Baterry connect to the motor control shield. BT module connect to into the shield.
I use the battery is 9V. It is powered by two motors and bt module. Maybe I need more power?
9 Volt batteries are horrible for an Arduino project. Also please tell me you are not putting 9V directly into the BT module and servos, the Arduino is fine, it can handle 9V, but not the BT and servos.
What you need to do to engines and BT module for proper energy, and everything is functioning?