What the ‘non-class type’ error translates as is that you’ve tried to call a member function on a type that isn’t a class (only classes can have member functions).
That’s why I was asking about the definition and the calling line, the answer to that error is usually an incorrect definition or something funky with the way something’s being called.
int main(){
setup();
WiiChuck nunchuck(P0_5, P0_4);
nunchuck_data_t nunchuckData;
Didn’t help.
Maybe that library doesn’t work, I found with arduino libraries, a lot of wii nunchuck code just din’t work at all, despite everyone saying that it did.
Using the following to detect i2c devices, I’m getting mixed results.
I have a wireless wii classic controller adapter (8bitdo) which will return the correct address (0xA4), but a real classic controller and two nunchucks that return 8 addresses from 0x00 to 0x0E.
game.display.clear();
I2C i2c(P0_5, P0_4); // sda, scl
game.display.setCursor(0,0);
game.display.print("Searching...\n");
int count = 0;
for (int address=0; address<256; address+=2) {
if (!i2c.write(address, NULL, 0)) { // 0 returned is ok
sprintf(tempText,"I2C address 0x%02X\n", address);
game.display.print(tempText);
count++;
}
}
sprintf(tempText,"%d devices found\n\n\n", count);
game.display.print(tempText);
I wonder is this a quirk or Pokitto, or of the wii controllers?
@spinal I just hooked up a ADXL345 I2C 3-axis accelerometer. Worked immediately with no issues on hardware I2C when PROJ_ENABLE_SOUND = 0; (yes, accelerometer lib will be added to the repository)
So not sure about what the problems are that you’re facing with the nunchucks