Go Down

Topic: expected initializer before void function (Read 1 time) previous topic - next topic

kikivick

hi, im new to arduino, and when i compile my code the next error appears it says that  expected initializer before void function, i've already read in the web and says that maybe i need a semicolon but i cant find where
my code is the next, i would appreciate if you could tell my where my error is. 


  //constantes para pines
const int xpin = A0; //pin x
const int ypin = A1; //pin y
const int zpin = A2; //pin z
const unsigned int baud_rate = 9600;
int x; //variable valor x
int y; //variable valor y
int z; //variable valor z
int contador = 0;   //contador de valores
  //valores obtenidos de getval
int valx1;
int valy1;
int valz1;
int constante=415;  //constante para saber el numero que salio
  //diferencias entre constante y valores obtenidos
int dif1;
int dif2;
int dif3;
int numero

  //inicio del serial
void setup() //
{
  Serial.begin(baud_rate); //
  for(contador=0;contador<2;contador++)
   {
     x = GetValX();
     y = GetValY();
     z = GetValZ();
   }
}

dxw00d

#1
Apr 30, 2012, 10:13 pm Last Edit: Apr 30, 2012, 10:15 pm by dxw00d Reason: 1
Code: [Select]
int numero
Here?

Please use [code]...[/code] tags when posting code. Use the # button above the text entry box.

CrossRoads

Yes,
int numero
needs a ; at the end.

int numero ;

Didn't the IDE also highlight the line for you, or indicate the line number? (looks like line 19)
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

kikivick


CrossRoads

Easy to miss.
You'll see those sooner after coding for 6 months 8)
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy