Go Down

Topic: arduino compile error (Read 1 time) previous topic - next topic

manish_rocker

hey i m new to this site......
actually m makin a line follower robot based on d PID algorithm....
m gettin a few compile errors

pid_n_linefollower:78: error: stray '\' in program
pid_n_linefollower:83: error: stray '\' in program
pid_n_linefollower:86: error: stray '\' in program
pid_n_linefollower:-1: error: expected initializer before 'current_position'
pid_n_linefollower:17: error: expected initializer before 'current_position'

ive attached d code ...
plz hlp me
thnxx in advance......  :)


KeithRB

Well, I see funky characters like this:
unsigned int Error = target_pos â€" current_pos;

so that is probably the problem. Whatever that is, it is not a C operator.

PaulS

Code: [Select]
unsigned int RPM of Left motor = pwm - (Correction);
unsigned int   RPM of Right motor = pwm + (Correction);

You can't have spaces in variable names.

Code: [Select]
calculate current_position ();
What is this supposed to be/do?

Code: [Select]
if (error==0)
  {
   analogWrite (RPM of Left motor,3) && analogWrite (RPM of Right motor,5)
  }
  if (error < 0)                                                      // line follower algorithm
  {
    analogWrite (RPM of Left motor,3);
  }
 
  if (error > 0)
  {
    analogWrite (RPM of Right motor,5);
  }
}

Putting the arguments in the correct order is useful, too.

manish_rocker

thnxx 4 d reply .......
ive jus started with c and arduino n m nt a skilled c programmer.... :(
bt m learnin frm u ppl thnxx a lot
Code:
calculate current_position ();
What is this supposed to be/do?
itz to calculate the current position of d robot in respect to d line.....

AWOL

Is there something wrong with your vowel keys?
Your last post was hopelessly garbled.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

manish_rocker

what are those expected initializers before....???
and     stray '\' in program

wildbill

It's usually not very helpful to chase down every error the compiler produces - if you fix the first one, others will often vanish too. PaulS has pointed out a number of issues which you would be well advised to fix first. If you still have compiler issues then, post your amended code and the new error messages

JimboZA

Quote
if you fix the first one, others will often vanish too


I'll second that.... so often the case
Arduino ethernet server here.... http://jimboza.gotdns.com:8085/ (not always alive tho)
Don't read too much into my being a Faraday Member: that just means I post a lot, not that I know much.

No PMs for help please

AWOL

Code: [Select]
analogWrite (RPM of Left motor,3) && analogWrite (RPM of Right motor,5)
Ignoring, for a moment, the spaces in the variable names, analogWrite doesn't return a value, so putting two in an expression like that doesn't make a lot of sense.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

manish_rocker

@ AWOL
Code: [Select]
[analogWrite (RPM of Left motor,3) && analogWrite (RPM of Right motor,5)]

that was a mistake by me sry  :smiley-red: .........
bt ill try to fix d errors pointed by paulS

manish_rocker

sry 4 d typing errors in d forum .....
bcoz m vry new to this forum


Arrch

Are you very new to typing?

You aren't composing a text message, so don't type like it.


Go Up