Pages: [1]   Go Down
Author Topic: expected initializer before void function  (Read 961 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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();
   }
}
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
int numero
Here?

Please use [code]...[/code] tags when posting code. Use the # button above the text entry box.
« Last Edit: April 30, 2012, 03:15:30 pm by dxw00d » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26422
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks! i didnt see that smiley-razz
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26422
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Easy to miss.
You'll see those sooner after coding for 6 months smiley-cool
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: