WiiCoasterUI error

Hi, I have tried using the WiiCoasterUI library to mesure g-forces with an wii nunchuck controler.
At first I got the error

WConstants.h: No such file or directory

and followed instructions online to replace it with

#include <Arduino.h>

It removed the error and allowed me to upload the code to the arduino but gave me a few new error that I can’t seem to find anywhere online.

warning: #warning “This header file is obsolete. Use <avr/interrupt.h>.” [-Wcpp]

and

warning: ‘SIG_2WIRE_SERIAL’ appears to be a misspelled signal handler, missing __vector prefix [-Wmisspelled-isr]

The whole program is copied of the site https://github.com/todbot/GPSWiiRecorder/tree/master/WiiCoasterUI
However the program is from 2009 but should’nt it work on a new arduino board aswell.
If it helps im following the project http://cdn.makezine.com/make/television/09/flight_recorder.pdf

Thank you!

gave me a few new error

You seem to have missed the fact that warning != error.

PaulS:
You seem to have missed the fact that warning != error.

Thanks for answering, so my problems are just warnings? Even if there just warnings I cant get it go work and dont get any readouts om the lcd display. Shouldnt a completly copied code just work?

so my problems are just warnings?

No, they are thingamabobs, cleverly masquerading as warnings. Why do you suppose the messages all contain "warning", rather than "error"?

Shouldnt a completly copied code just work?

If you have the EXACT same hardware (Arduino, Wii hardware, etc.) and the EXACT same version of the IDE, yes. ANY deviation, and you need to test.

I had excellent success with this code modified from another source to work with my wireless WiiChuck.
The code works with every wiichuck I tried.
The i2c buss requires pull up resisters if you weren’t aware.

Example Useage:

#include <NewWiiChk.h>
NewWiiChk WiiChk;

void setup() {
  // put your setup code here, to run once:

  Serial.begin(115200);
}

void loop() {
  WiiChk.get_data(); // Load the data from  the WiiChuck

  WiiChk.print_data();

  int XV = WiiChk.joyx();
  int YV = WiiChk.joyy();
  int AX = WiiChk.accelx();
  int AY = WiiChk.accely();
  int AZ = WiiChk.accelz();
  int ZV = WiiChk.zbutton();
  int CV = WiiChk.zbutton();
}

Z

keywords.txt (638 Bytes)

NewWiiChk.cpp (4.7 KB)

NewWiiChk.h (741 Bytes)

oscarseg:
Shouldnt a completly copied code just work?

That depends on where you copied it from. There's lots of bad code out there on the internets.