Error: expected constructor, destructor, or type conversion before ';' token. Error is occuring at void_mStop

int signal_emission = 7; //The emission of an ultrasonic signal
int signal_recieve = 8; //Recieving back the signal

//mapping of motor variables to arduino I/O pins

/3/int motor_right_out1 = 13; //Turning of right motor through output 1 from H bridge - clockwise - Green wire
int motor_right_out2 = 12; //Turning of right motor through output 2 from H bridge - anticlockwise - Yellow wire

int speed_control_mtr_left = 3; //Controlling RPM of left motor through PWM pins
int motor_left_out3 = 11; //Turning of left motor through output 3 from H bridge - clockwise - Orange wire
int motor_left_out4 = 10; //Turning of left motor through output 4 from H bridge - anticlockwise - Purple wire

//function for the robot to move forward
void_mForward(){
analogWrite(speed_control_mtr_right, 80); //Using an analog function to determine the speed of the right motor
// right motor turning clockwise
digitalWrite(motor_right_out1,HIGH);
digitalWrite(motor_right_out2,LOW);

analogWrite(speed_control_mtr_left, 80); //Using an analog function to determine the speed of the left motor
// left motor turning clockwise
digitalWrite(motor_left_out3,HIGH);
digitalWrite(motor_left_out4,LOW);

Serial.print("ROBOT_MOVING_FORWARD");
}
//function for robot to move backwards
void_mBackwards(){
analogWrite(speed_control_mtr_right, 80); //Using an analog function to determine the speed of the right motor
// right motor turning anticlockwise
digitalWrite(motor_right_out1,LOW);
digitalWrite(motor_right_out2,HIGH);

analogWrite(speed_control_mtr_left, 80); //Using an analog function to determine the speed of the left motor
// left motor turning anticlockwise
digitalWrite(motor_left_out3,LOW);
digitalWrite(motor_left_out4,HIGH);

Serial.print("ROBOT_MOVING_BACKWARD");
}

//function for robot turning left
void_mLeft(){
analogWrite(speed_control_mtr_right, 80); //Using an analog function to determine the speed of the right motor
// right motor turning clockwise
digitalWrite(motor_right_out1,HIGH);
digitalWrite(motor_right_out2,LOW);

analogWrite(speed_control_mtr_left, 80); //Using an analog function to determine the speed of the left motor
// left motor turning anticlockwise
digitalWrite(motor_left_out3,LOW);
digitalWrite(motor_left_out4,HIGH);

Serial.print("ROBOT_TURNING_LEFT");
}

//function for robot turning right
void_mRight(){

analogWrite(speed_control_mtr_right, 80); //Using an analog function to determine the speed of the right motor
// right motor turning anticlockwise
digitalWrite(motor_right_out1,LOW);
digitalWrite(motor_right_out2,HIGH);

analogWrite(speed_control_mtr_left, 80); //Using an analog function to determine the speed of the left motor
// left motor turning anticlockwise
digitalWrite(motor_left_out3,HIGH);
digitalWrite(motor_left_out4,LOW);

Serial.print("ROBOT_TURNING_RIGHT");

}

//function for robot to stop
void_mStop(){
analogWrite(speed_control_mtr_right, 0); //Using an analog function to determine the speed of the right motor
// right motor stop
digitalWrite(motor_right_out1,LOW);
digitalWrite(motor_right_out2,LOW);

analogWrite(speed_control_mtr_left, 0); //Using an analog function to determine the speed of the left motor
// left motor stop
digitalWrite(motor_left_out3,HIGH);
digitalWrite(motor_left_out4,LOW);

Serial.print("ROBOT_STOP");

}

void setup() {
// put your setup code here, to run once:

//defining Input & Outputs of the ultrasonic sensor

pinMode(signal_emission, OUTPUT); //Emission of wave
pinMode(signal_recieve, INPUT); //Recieving wave

//defining Inputs & Outputs of the motor system

pinMode (speed_control_mtr_right, OUTPUT); //Defining PWM pin 5 as an output
pinMode (motor_right_out1, OUTPUT); //Defining right motor cw as an output
pinMode (motor_right_out2, OUTPUT); //Defining right motor acw as an output

pinMode (speed_control_mtr_left,OUTPUT); //Defining PWM pin 3 as an output
pinMode (motor_left_out3, OUTPUT); //Defining left motor cw as an output
pinMode (motor_left_out4, OUTPUT); //Defining left motor acw as an output

You are not going to make a lot of friends with that first post.

Read the forum guidelines to see how to properly post code and some information on how to get the most from this forum.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

Please include the entire error message. It is easy to do. There is a button (lower right of the IDE window) called "copy error message". Copy the error and paste into a post in code tags. Paraphrasing the error message leaves out important information.

ok thanks

What is wrong with that function name? Maybe Mr. void needs some space?

Hi

Etc.......
,
This code is for what kind of IDE and micro controller?

loop() function, "void loop()" is missing.
In addition to missing some definitions.

Use cntl T to organize your code and follow @groundFungus guidance

Here is a version that compiles without errors.
The end of the file got cut off when you posted.
The declaration of 'speed_control_mtr_right' was missing. There was a "/3/" at the beginning of a line. There were spaces missing between the 'void' keyword and the name of some functions.

const int signal_emission = 7; // The emission of an ultrasonic signal
const int signal_recieve = 8; // Recieving back the signal

//mapping of motor variables to arduino I/O pins

const int speed_control_mtr_right = 6; //Controlling RPM of right motor through PWM pins
const int motor_right_out1 = 13; //Turning of right motor through output 1 from H bridge - clockwise - Green wire
const int motor_right_out2 = 12; //Turning of right motor through output 2 from H bridge - anticlockwise - Yellow wire

const int speed_control_mtr_left = 3; //Controlling RPM of left motor through PWM pins
const int motor_left_out3 = 11; //Turning of left motor through output 3 from H bridge - clockwise - Orange wire
const int motor_left_out4 = 10; //Turning of left motor through output 4 from H bridge - anticlockwise - Purple wire

//function for the robot to move forward
void _mForward()
{
  analogWrite(speed_control_mtr_right, 80); //Using an analog function to determine the speed of the right motor
  // right motor turning clockwise
  digitalWrite(motor_right_out1, HIGH);
  digitalWrite(motor_right_out2, LOW);

  analogWrite(speed_control_mtr_left, 80); //Using an analog function to determine the speed of the left motor
  // left motor turning clockwise
  digitalWrite(motor_left_out3, HIGH);
  digitalWrite(motor_left_out4, LOW);

  Serial.print("ROBOT_MOVING_FORWARD");
}

//function for robot to move backwards
void _mBackwards()
{
  analogWrite(speed_control_mtr_right, 80); //Using an analog function to determine the speed of the right motor
  // right motor turning anticlockwise
  digitalWrite(motor_right_out1, LOW);
  digitalWrite(motor_right_out2, HIGH);

  analogWrite(speed_control_mtr_left, 80); //Using an analog function to determine the speed of the left motor
  // left motor turning anticlockwise
  digitalWrite(motor_left_out3, LOW);
  digitalWrite(motor_left_out4, HIGH);

  Serial.print("ROBOT_MOVING_BACKWARD");
}

//function for robot turning left
void _mLeft()
{
  analogWrite(speed_control_mtr_right, 80); //Using an analog function to determine the speed of the right motor
  // right motor turning clockwise
  digitalWrite(motor_right_out1, HIGH);
  digitalWrite(motor_right_out2, LOW);

  analogWrite(speed_control_mtr_left, 80); //Using an analog function to determine the speed of the left motor
  // left motor turning anticlockwise
  digitalWrite(motor_left_out3, LOW);
  digitalWrite(motor_left_out4, HIGH);

  Serial.print("ROBOT_TURNING_LEFT");
}

//function for robot turning right
void _mRight()
{

  analogWrite(speed_control_mtr_right, 80); //Using an analog function to determine the speed of the right motor
  // right motor turning anticlockwise
  digitalWrite(motor_right_out1, LOW);
  digitalWrite(motor_right_out2, HIGH);

  analogWrite(speed_control_mtr_left, 80); //Using an analog function to determine the speed of the left motor
  // left motor turning anticlockwise
  digitalWrite(motor_left_out3, HIGH);
  digitalWrite(motor_left_out4, LOW);

  Serial.print("ROBOT_TURNING_RIGHT");
}

//function for robot to stop
void _mStop()
{
  analogWrite(speed_control_mtr_right, 0); //Using an analog function to determine the speed of the right motor
  // right motor stop
  digitalWrite(motor_right_out1, LOW);
  digitalWrite(motor_right_out2, LOW);

  analogWrite(speed_control_mtr_left, 0); //Using an analog function to determine the speed of the left motor
  // left motor stop
  digitalWrite(motor_left_out3, HIGH);
  digitalWrite(motor_left_out4, LOW);

  Serial.print("ROBOT_STOP");
}

void setup()
{
  // put your setup code here, to run once:

  //defining Input & Outputs of the ultrasonic sensor

  pinMode(signal_emission, OUTPUT); //Emission of wave
  pinMode(signal_recieve, INPUT); //Recieving wave

  //defining Inputs & Outputs of the motor system

  pinMode (speed_control_mtr_right, OUTPUT); //Defining PWM pin 5 as an output
  pinMode (motor_right_out1, OUTPUT); //Defining right motor cw as an output
  pinMode (motor_right_out2, OUTPUT); //Defining right motor acw as an output

  pinMode (speed_control_mtr_left, OUTPUT); //Defining PWM pin 3 as an output
  pinMode (motor_left_out3, OUTPUT); //Defining left motor cw as an output
  pinMode (motor_left_out4, OUTPUT); //Defining left motor acw as an output

///////////// The file was cut off here ///////////
}

void loop() {}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.