WHY IT IS COMING?

ATTCHMENT is half code my project . During writing code I think to compile my code now to check whether I am writing code correctly or not.

But after compiling I got 2 errors . THAT ARE -------->1.expected initializer before 'void'[HIGHLIGHTING void loop()] 2.expected initializer before 'void'[HIGHLIGHTING void setup()}


WHY IT IS COMING?

HELP ME!!!!!!!!!!!!!!!!!!!!!!!!

CODE_FOR_ADVANCED_ROBO_VACCUM_CLEANER__NAME____Rhobus__VAC.clea.ino (1.03 KB)

Post all the code, post the exact error message.

Edit: Don't report sound advice to the moderators.

Have not looked at the code, usually the error is related to a missing semicolon ";" or a missing library.

Check the </> code tags when posting your code.
I - for one - rarely read 'attached' code

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

What model Arduino are you using?

Tom... :slight_smile:

TomGeorge:
Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

What model Arduino are you using?

Tom... :slight_smile:

Sorry i didn't know how to post code but next time i will do in same manner as shown.

And i am using ARDUINO UNO

And i am using ARDUINO UNO

You still need a semicolon, whatever processor you're using.

#include <LiquidCrystal_I2C.h>
#include <Keypad.h>
#include <Wire.h>
#include <Servo.h>
# define ls a0 / LEFT IR SENSOR
# define rs a3 / RIGHT IR SENSOR
# define rm 9 / RIGHT WHEEL MOTOR
# define lm 10 / LEFT WHEEL MOTOR
# define buzled 11 / BUZZER & LED
# define echoPin a1 / ECHO PIN OF ULTRASONIC SENSOR
# define trigPin a2 / TRIG PIN OF ULTRASONIC SENSOR
# define VM 12 / VACCUM MOTOR  
const byte ROWS = 4; 
const byte COLS = 3; 

char hexaKeys[ROWS][COLS] = {
  {'1', '2', '3'},
  {'4', '5', '6'},
  {'7', '8', '9'},
  {'*', '0', '#'}
};

byte rowPins[ROWS] = {9, 8, 7, 6}; 
byte colPins[COLS] = {5, 4, 3}; 

Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); 

LiquidCrystal_I2C lcd(0x21, 16, 2);

Servo myservo
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  myservo.attach(13);
  pinMode(ls,INPUT);
  pinMode(rs,INPUT);
  pinMode(lm,OUTPUT);
  pinMode(rm,OUTPUT);
  pinMode(buzled,OUTPUT);
  pinMode(vm,OUTPUT);
  pinMode(trigPin, OUTPUT);// set the trig pin to output (Send sound waves)
  pinMode(echoPin, INPUT);// set the echo pin to input (recieve sound waves)

  lcd.init();
  lcd.backlight();
  lcd.clear();
  lcd.print("  HELLO!ARE YOU ");
  lcd.setCursor(0,1);
  lcd.print("FEARING WITH ME?");
  delay(10000);
  lcd.clear();
  lcd.print("     LET ME     ");
  lcd.setCursor(0,1);
  lcd.print("INTRODUCE MYSELF");
  delay(5000);
  lcd.clear();
  lcd.print("     LET ME     ");
  lcd.setCursor(0,1);
  lcd.print("INTRODUCE MYSELF");
  delay(5000);
  lcd.clear();
}

void loop() {
  // put your main code here, to run repeatedly:

}
Servo myservo

A semicolon missing.
This has already been mentioned.

AWOL:

Servo myservo

A semicolon missing.
This has already been mentioned.

Now it is working .......

THANKS!!!!!!!!!!

PRABHASKUMAR:
Now it is working .......

THANKS!!!!!!!!!!

How? Did you fix the "vm" and "VM" variable name?
And this;

# define ls a0 / LEFT IR SENSOR

Should be this;

#define ls A0 // LEFT IR SENSOR

along with the other # define statements?
C++ is case sensitive so vm variable is not the same as VM variable.

Can you post your working code please?

Tom... :slight_smile:

Yes, and I fixed it before your message.

#include <LiquidCrystal_I2C.h>
#include <Keypad.h>
#include <Wire.h>
#include <Servo.h>
# define ls A0 // LEFT IR SENSOR
# define rs A3 // RIGHT IR SENSOR
# define rm 9 // RIGHT WHEEL MOTOR
# define lm 10 // LEFT WHEEL MOTOR
# define buzled 11 // BUZZER & LED
# define echoPin A1 // ECHO PIN OF ULTRASONIC SENSOR
# define trigPin A2 // TRIG PIN OF ULTRASONIC SENSOR
# define VM 12 // VACCUM MOTOR  
const byte ROWS = 4; 
const byte COLS = 3; 

char hexaKeys[ROWS][COLS] = {
  {'1', '2', '3'},
  {'4', '5', '6'},
  {'7', '8', '9'},
  {'*', '0', '#'}
};

byte rowPins[ROWS] = {9, 8, 7, 6}; 
byte colPins[COLS] = {5, 4, 3}; 

Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); 

LiquidCrystal_I2C lcd(0x21, 16, 2);

Servo myservo;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  myservo.attach(13);
  pinMode(ls,INPUT);
  pinMode(rs,INPUT);
  pinMode(lm,OUTPUT);
  pinMode(rm,OUTPUT);
  pinMode(buzled,OUTPUT);
  pinMode(VM,OUTPUT);
  pinMode(trigPin, OUTPUT);// set the trig pin to output (Send sound waves)
  pinMode(echoPin, INPUT);// set the echo pin to input (recieve sound waves)

  lcd.init();
  lcd.backlight();
  lcd.clear();
  lcd.print("  HELLO!ARE YOU ");
  lcd.setCursor(0,1);
  lcd.print("FEARING WITH ME?");
  delay(10000);
  lcd.clear();
  lcd.print("     LET ME     ");
  lcd.setCursor(0,1);
  lcd.print("INTRODUCE MYSELF");
  delay(5000);
  lcd.clear();
  lcd.print("I'm robus_vaccum");
  lcd.setCursor(0,1);
  lcd.print("    cleaner    ");
  delay(5000);
  lcd.clear();
 
  lcd.print("1-->TO CLEAN ,");
  lcd.setCursor(0,1);
  lcd.print("2-->TO PLAY ,");
  delay(5000);
  lcd.print("3->TO CLEAN LINE");
  lcd.setCursor(0,1);
  lcd.print("CHOOSE THE NO.");
  delay(5000);
  lcd.clear();
  lcd.print("AND   PRESS");
  lcd.setCursor(0,1);
  lcd.print("ON      KEYPAD.");
  delay(5000);
  lcd.clear();
}
void loop() {
  // put your main code here, to run repeatedly:

}

Hello,

#include <LiquidCrystal_I2C.h>
#include <Keypad.h>
#include <Wire.h>
#include <Servo.h>
# define ls A0 // LEFT IR SENSOR
# define rs A3 // RIGHT IR SENSOR
# define rm 9 // RIGHT WHEEL MOTOR
# define lm 10 // LEFT WHEEL MOTOR
# define buzled 11 // BUZZER & LED
# define echoPin A1 // ECHO PIN OF ULTRASONIC SENSOR
# define trigPin A2 // TRIG PIN OF ULTRASONIC SENSOR
# define VM 12 // VACCUM MOTOR  
const byte ROWS = 4; 
const byte COLS = 3; 

char hexaKeys[ROWS][COLS] = {
  {'1', '2', '3'},
  {'4', '5', '6'},
  {'7', '8', '9'},
  {'*', '0', '#'}
};

byte rowPins[ROWS] = {9, 8, 7, 6}; 
byte colPins[COLS] = {5, 4, 3}; 

Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); 

LiquidCrystal_I2C lcd(0x21, 16, 2);

Servo myservo;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  myservo.attach(13);
  pinMode(ls,INPUT);
  pinMode(rs,INPUT);
  pinMode(lm,OUTPUT);
  pinMode(rm,OUTPUT);
  pinMode(buzled,OUTPUT);
  pinMode(VM,OUTPUT);
  pinMode(trigPin, OUTPUT);// set the trig pin to output (Send sound waves)
  pinMode(echoPin, INPUT);// set the echo pin to input (recieve sound waves)

  lcd.init();
  lcd.backlight();
  lcd.clear();
  lcd.print("  HELLO!ARE YOU ");
  lcd.setCursor(0,1);
  lcd.print("FEARING WITH ME?");
  delay(10000);
  lcd.clear();
  lcd.print("     LET ME     ");
  lcd.setCursor(0,1);
  lcd.print("INTRODUCE MYSELF");
  delay(5000);
  lcd.clear();
  lcd.print("I'm robus_vaccum");
  lcd.setCursor(0,1);
  lcd.print("    cleaner    ");
  delay(5000);
  lcd.clear();
 
  lcd.print("1-->TO CLEAN ,");
  lcd.setCursor(0,1);
  lcd.print("2-->TO PLAY ,");
  delay(5000);
  lcd.print("3->TO CLEAN LINE");
  lcd.setCursor(0,1);
  lcd.print("CHOOSE THE NO.");
  delay(5000);
  lcd.clear();
  lcd.print("AND   PRESS");
  lcd.setCursor(0,1);
  lcd.print("ON      KEYPAD.");
  delay(5000);
  lcd.clear();
}
void loop() {
  // put your main code here, to run repeatedly:

}

Please help me to write the code inwhich if any key of keypad is pressed then lcd 16x2 display 'THANK you'

Please help you what?

Please help me to write the code inwhich if any key of keypad is pressed then lcd 16x2 display 'THANK you'

study the keypad library examples, and give it a try.

(deleted)

I can't get help from your shared website
:confused:

bye - come back in a few days

spycatcher2k:
@PRABHASKUMAR - you have crossposted this thread! I have reported you for this, and also added you to the 'do not help this person under any circumstances' list.

There's a list for that? Great idea.

The OP seems want people to simply write his code for him. Looking at those defines, I don't have much hope for his "advanced robotic vacuum cleaner" project.