Arexx AAR Robot need help

I bought a Arexx AAR Robot..with Bluetooth kit and + HC - SR04 and now i need help...
Only need now a prog for Hc - SR04: video : https://www.youtube.com/watch?v=ap3PVPQpQoE&list=UU82oJxPw4qyx4sPIllOEg3A
**EDIT :::DONE !!!**I found 1 proramm for Bluetooth kit but its not working....#

test.ino:7:10: error: #include expects "FILENAME" or
test.ino: In function 'void loop()':
test.ino:42:29: error: 'gt' was not declared in this scope
test.ino:42:31: error: expected ')' before ';' token
test.ino:42:34: error: expected ';' before ')' token
test.ino:65:1: error: expected '}' at end of input

always this error when i verify it....

orginal Programm

/*
Arduino-Roboter AAR-04 bluetooth control techfreak.pl dla conrad.pl
*/

#include
SoftwareSerial mySerial(8, 4); // RX, TX
char incomingByte;
void setup()
{
pinMode(10, OUTPUT);
//pin 9 left backward
pinMode(9, OUTPUT);
//pin 5 right foreward
pinMode(5, OUTPUT);
//pin 6 right backward
pinMode(6, OUTPUT);
//Then set the start value of the signals to zero:
analogWrite(9, 0);
analogWrite(10, 0);
analogWrite(5, 0);
analogWrite(6, 0);
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.println("hello USB");
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
mySerial.println("Hello, BT");
}
void loop() // run over and over
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
digitalWrite(6,LOW); digitalWrite(5,LOW); //stop motors
digitalWrite(9,LOW); digitalWrite(10,LOW); //stop motors
if (mySerial.available() > 0) { // if received UART data
incomingByte = mySerial.read(); // raed byte
if(incomingByte == '8') {
digitalWrite(10,LOW); analogWrite(9,200); //##set pin 10 to ground!## set speed left motor 200 backward
digitalWrite(6,LOW); analogWrite(5,200); //##set pin 5 to ground!## set speed right motor 200 backward
delay(500); }
if(incomingByte == '4') {
digitalWrite(9,LOW); analogWrite(10,200); //##set pin 9 to ground!## set speed left motor 200 foreward
digitalWrite(6,LOW); digitalWrite(5,LOW); //make a left turn
delay(500); }
if(incomingByte == '2') {
digitalWrite(9,LOW); analogWrite(10,200); //##set pin 9 to ground!## set speed left motor 200 foreward
digitalWrite(5,LOW); analogWrite(6,200); //##set pin 6 to ground!## set speed right motor 200 foreward
delay(500); }
if(incomingByte == '6') {
digitalWrite(5,LOW); analogWrite(6,200); //##set pin 5 to ground!## set speed right motor 200 backward
digitalWrite(9,LOW); digitalWrite(10,LOW); //make a right turn
delay(500); }
if(incomingByte == '5') {
digitalWrite(6,LOW); digitalWrite(5,LOW); //stop motors
digitalWrite(9,LOW); digitalWrite(10,LOW); //stop motors
}
}
}

PLS Help me....and i also need one programm for HC - SR04 ....Ultraschallsensor.....pls....pls help AFAP........

You are using the Software Serial library, yet it is not included in your sketch.

Ultraschallsensor.....pls....pls help AFAP........

What? Is this homework, because we don't do that here. A good majority of us have already done our homework years ago.

Upon closer inspection, What is this? How many times are you going to send that same data?

if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
digitalWrite(6,LOW); digitalWrite(5,LOW); //stop motors
digitalWrite(9,LOW); digitalWrite(10,LOW); //stop motors
if (mySerial.available() > 0) // What? {

For the Ultrasonic Ping sensor, have you looked into the NewPing library?

its not a homework....its a project ..where i need help...my project it about aar roboter with MQ7 sensor but before that i wanted to test bluetooth and ultaschallsensor

found this Bluetooth progamm : Test Arexx Arduino Robot AAR-04 · Przemek

but where is the problem always when i verify it shows the same prob pls help:

test.ino:7:10: error: #include expects "FILENAME" or
test.ino: In function 'void loop()':
test.ino:42:29: error: 'gt' was not declared in this scope
test.ino:42:31: error: expected ')' before ';' token
test.ino:42:34: error: expected ';' before ')' token
test.ino:65:1: error: expected '}' at end of input?,

I am newie dont know so much about it pls....i want to start with MQ7 after it work with bluetooth pls

test.ino:7:10: error: #include expects "FILENAME" or

#include

Looks pretty self-explanatory to me.

test.ino:42:29: error: 'gt' was not declared in this scope

 if (mySerial.available() > 0)

if (mySerial.available() > 0) perhaps?

changed :
#include <SoftwareSerial.h>
SoftwareSerial mySerial(8, 4); // RX, TX
char incomingByte;
void setup()

but one more prob :

sketch_sep15c.cpp: In function 'void setup()':
sketch_sep15c:27: error: no match for 'operator!' in '!Serial'
sketch_sep15c.cpp:31: note: candidates are: operator!(bool)

Since you're not using an Arduino Leonardo, you can take this out.

while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}

One other thing, why have a button to stop the motors, if you already have this in your code.

void loop() // run over and over
{
if (Serial.available())
mySerial.write(Serial.read());
digitalWrite(6,LOW);
** digitalWrite(5,LOW); //stop motors**
** digitalWrite(9,LOW);**
** digitalWrite(10,LOW);** //stop motors

thx man

is it possible that you can help me with HC - SR04 ???
i have the video but need this program and how to connect it..

I'm pretty sure there are plenty of examples for the SR04 - have you tried the Playground?

yeah i tried it but could not find something usefull...i need it for a roboter .....their is also a video of it but i need this program...because after that i want to start with MQ7 and MQ2 so pls help me to get this prog :slight_smile:

Look into that link I gave you for the NewPing library and find two available pins on the robot to use. From a picture I was able pull up, you should have a few pins you can use.

but i want to have it like this....have same robot...pls..Arexx AAR 04 Arduino Robot HC-SR04 - YouTube

I'd start by cleaning up the code you posted, like giving the pins sensible names instead of just numbers, then maybe work through some of the programming examples.

AWOL......now it works...Bluetooth Programm work now....and thx for your help....but the next preblem is that i need a pregramm for HC-SR04...i also posted a video link...want the same one....pls help me becaue i want to start after that with MQ2 and MQ7 sensors..pls

but the next preblem is that i need a pregramm for HC-SR04.

Don't think of it as a problem, but rather as an opportunity to learn.
As I said earlier, there are plenty of examples of how to use the HC-SR04.

.now it works

But it isn't very good code, and you would benefit by spending some more time on making it more legible and maintainable.

it is a problem for me becasue i want to start with Alkohol stuff...MQ2,MQ7....but before that i need to have bluetooth...and HC- SR04....i got Bluetooth with your help..and now need SR04....pls help me

I can't help you because you haven't shown me what you've done so far.

i want to start with Alkohol stuff.

Me too. Cheers!

Write a code that makes the robot drive forward while continuously checking the distance. If the distance is less than say 8 inches, have the robot reverse to the left until the distance is more than 8 inches.

It's simple once you download the NewPing library.

could you pls write a exsample for me ..only if possible ??

Have you download the library, Yes or No?