error at global scope !

hi,
this is a programme i worte for my liney follower and it s giving a error which i cant understand

/*------------------LINEY_V2------------------*/
#include <PID_Beta6.h>
int val_right,val_left,error;
unsigned int change;
double Setpoint, Input, Output;
PID myPID(&Input, &Output, &Setpoint,2,5,1);



/*!!!!MOTOR SETIUP!!!!*/

#define m1p1 2;
#define m1p2 3;
#define m2p1 4;
#define m2p2 5;

/*######pwm_set#####*/

#define pwm_right 9;
#define pwm_left 10;

/*setting of the pins*/

void setup()
{
  Input = change;
  Setpoint = 100;
  myPID.SetMode(AUTO);
  pinMode(0,INPUT);
  pinMode(1,INPUT);
  pinMode(2,INPUT);
  pinMode(3,INPUT);
  pinMode(4,INPUT);
  pinMode(5,INPUT);
  pinMode(m1p1,OUTPUT);
  pinMode(m1p2,OUTPUT);
  pinMode(m2p1,OUTPUT);
  pinMode(m2p2,OUTPUT);
}

/*--------LOOP---------*/

void loop()
{
  /*set motor to move forward , keep setting to gain accuracy */
  
  setmotor();

  /*calculating values to check the alignment of the bot WRT line*/

  val_right = ((analogRead(0))+(analogRead(1))+(analogRead(2))); 
  val_left  = ((analogRead(3))+(analogRead(4))+(analogRead(5)));

  /*calculating the difference and setting it as an unsigned int to do pwm*/
   
  change  = (val_left-val_right);
  
  /*compute pid values*/
  
  Input = change;
  myPID.Compute();

  
  
  /*------PWM WRITE VALUES-----*/
   
  if(val_right>val_left) //decision as to which pwm pin to write on. 
  {
      analogWrite(10,OUTPUT);
  }
  else
  {
      analogWrite(9,OUTPUT);
  }
}

void setmotor();
{
    digitalWrite(m1p1,HIGH);
    digitalWrite(m1p2,LOW);
    digitalWrite(m2p1,HIGH);
    digitalWrite(m2p2,LOW);
}

Arduino 18 ; ubuntu 10.10 (maverick ) arduino duemilanove

ERROR

In function ‘void setup()’:
error: expected `)' before ‘;’ token In function ‘void loop()’:
At global scope:

#define has a name/value pair following the keyword. The value is substituted wherever the name appears in the code. You have:
#define m1p1 2;
The name is m1p1. The value is "2;".
You have:
pinMode(m1p1,OUTPUT);
The value is substituted:
pinMode(2;,OUTPUT);
This is not syntactically valid, so the compiler complains.

Sure miss the highlighting from the old forum. Much easier to see...

#define pwm_left 10;

Lose the semicolons on ALL your #defines

Thanks :slight_smile: hmm im really sorry for bringing this up i've previously gone through this :blush: :blush: but never remember :frowning: ! thanks again and any other sugessitions so as to improve the code ? ( port manipulation to increase speed ? )

Sure miss the highlighting from the old forum. Much easier to see...

YES! :frowning: atleast i mark up my replies in black as adviced by richard crowley but appears he's not being seen anymore ! :frowning:

Why do you give equal weight to all three sensors on each side? As the robot begins to veer off course, the inner sensors should detect that first. So, I would think that more weight (credence) should be given to the inner sensors, and less to the outer sensors.

@PAULS
Hmm.. im reconsidering now

port manipulation to increase speed

This is a moving object yes?
Anything you write in Arduino is going to operate hundreds or thousands of times faster than the sort of timescales your buggy needs.

Whilst you're still coming to terms with the language, leave the optimisations to the compiler.