First of all, my code:
#include <wiimote.h>
int nl = 0;
byte whammy = 0;
boolean whammyUp = true;
unsigned char data[6];
unsigned char id[6] = {0x00, 0x00, 0xA4, 0x20, 0x01, 0x03};
unsigned char cal[32]={
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
void timer(){
}
void setup(){
Serial.begin(9600);
Serial.println("Hello world!");
data[0] = 0b00000000;
data[1] = 0b00000000;
data[2] = 0b00000000;
data[3] = 0b00000000;
data[4] = 0b00000000;
data[5] = 0b00000000;
wm_init(id, data, cal, timer);
}
void updateWhammy(){
if(whammyUp){
whammy++;
if(whammy >= 31){
whammyUp = false;
}
}else{
whammy--;
if(whammy <= 0){
whammyUp = true;
}
}
}
void loop(){
if(Serial.available() > 0){
}
updateWhammy();
}
Second I put the wiimote.c, wiimote.h and wm_crypto.h; from here, in Arduino\libraries\wimmote.
Third this is the error at compile:
AutoGiutar.cpp.o: In function `setup':
C:\Users\(censor)\Desktop\arduino-1.0.4/AutoGiutar.ino:38: undefined reference to `wm_init(unsigned char*, unsigned char*, unsigned char*, void (*)())'
So, the function does not seem to want to be passed as an argument, I am new to this part and I have spent a while on Google looking for the solution.