By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,210 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

tengo un problema al copilar el copilador me dice: expected unqualified-id before '.'

P: 4
estoy aprendiendo y no se que me falla en el codigo:

//todos los derchos reservados

#include "ArduinoNunchuk.h"
#include <Wiichuck.h>
#include <Wire.h>



void setup(){
Wiichuck.calibrate();
Wiichuck.init(0,0);

Serial.begin(9600);
}
Jul 23 '17 #1

✓ answered by weaknessforcats

Lo siento pero me espanol no es Bueno.

Este codigo:

Expand|Select|Wrap|Line Numbers
  1. Wiichuck.calibrate();
tiene una problema por que no hay un objecto. In este manera:

Expand|Select|Wrap|Line Numbers
  1. Wiichuck obj;
  2. obj.calibrate();
Escribime otra vez si no entiendes.

Share this Question
Share on Google+
6 Replies


weaknessforcats
Expert Mod 5K+
P: 9,197
Lo siento pero me espanol no es Bueno.

Este codigo:

Expand|Select|Wrap|Line Numbers
  1. Wiichuck.calibrate();
tiene una problema por que no hay un objecto. In este manera:

Expand|Select|Wrap|Line Numbers
  1. Wiichuck obj;
  2. obj.calibrate();
Escribime otra vez si no entiendes.
Jul 23 '17 #2

P: 4
#include <Wiichuck.h>
#include <Wire.h>

Wiichuck obj;


void setup(){
obj.init(0,0);
obj.calibrate();

Serial.begin(9600);
}

void loop(){
if(obj.poll()){

Serial.print("x: ");
Serial.print(obj.accelX());
Serial.print(" y: ");
Serial.print(obj.accelY());
Serial.print(" z: ");
Serial.println(obj.accelZ());

Serial.print("x: ");
Serial.print(obj.joyX());
Serial.print(" y: ");
Serial.println(obj.joyY());

Serial.print("C: ");
Serial.print(obj.buttonC());
Serial.print(" Z: ");
Serial.println(obj.buttonZ());
}
delay(100);
}

if(obj.buttonZ> 1) {
digitalWrite(5, HIGH);
}


}


Although I change the name of chuck to obj I still mark the same error sincerely I do not know what's wrong here is the program
full
Jul 26 '17 #3

weaknessforcats
Expert Mod 5K+
P: 9,197
Donde esta el objeto Serial?

Mandame, por favor, in ejemplo de este error.
Jul 26 '17 #4

P: 4
realmente estoy inciando en esto de la programacion y este es como mi quinto codigo el mensaje de error dice:
nuchuck_arduino:37: error: expected unqualified-id before 'if'

if(obj.buttonZ> 1){

^

nuchuck_arduino:41: error: expected declaration before '}' token

}

^

exit status 1
expected unqualified-id before 'if'

ejecuntando el codigo anterior



__________________________________________________ __________________
english

I'm really starting this programming and this is like my fifth code the error message says:
Nuchuck_arduino: 37: error: expected unqualified-id before 'if'

If (obj.buttonZ> 1) {

^

Nuchuck_arduino: 41: error: expected declaration before '}' token

}

^

Exit status 1
Expected unqualified-id before 'if'

Executing the previous code
Jul 27 '17 #5

weaknessforcats
Expert Mod 5K+
P: 9,197
The compiler reports an error at line 37. This means that the compiler knew there is a problem when it got to the "if" on line 37. The actual error is before the if. It could be on any line before line 37.

Also, if you have many errors, only fix the first error. Then recompile. If there are still errors fix only the first one. Errors 2,3,4,5... may be caused by the first error and will disappear when the first error is fixed.

Es verdad que su ingles es mejor que mi espanol
Jul 28 '17 #6

P: 4
Many thanks the real problem is that I did not write well the concept of if a council to carry out this conversation use translator and it seems we got very well
Jul 29 '17 #7

Post your reply

Sign in to post your reply or Sign up for a free account.