Help, please, what does this mean, this pops up several times in the error window, here is the whole Error window, I really need some help here , I am pulling my hair out, I have been working on this for days.
Charley
WiiRemote\servoWii.cpp.o: In function
__static_initialization_and_destruction_0': C:\Documents and Settings\expressway\My Documents\Arduino\libraries\WiiRemote/servoWii.cpp:67: multiple definition of
myservo'
servoWii.cpp.o:C:\DOCUME~1\EXPRES~1\LOCALS~1\Temp\build8487534986814557710.tmp/servoWii.cpp:63: first defined here
WiiRemote\servoWii.cpp.o: In function__static_initialization_and_destruction_0': C:\Documents and Settings\expressway\My Documents\Arduino\libraries\WiiRemote/servoWii.cpp:67: multiple definition of
myservo1'
servoWii.cpp.o:C:\DOCUME~1\EXPRES~1\LOCALS~1\Temp\build8487534986814557710.tmp/servoWii.cpp:63: first defined here
WiiRemote\servoWii.cpp.o: In function__static_initialization_and_destruction_0': C:\Documents and Settings\expressway\My Documents\Arduino\libraries\WiiRemote/servoWii.cpp:67: multiple definition of
wiiremote'
servoWii.cpp.o:C:\DOCUME~1\EXPRES~1\LOCALS~1\Temp\build8487534986814557710.tmp/servoWii.cpp:63: first defined here
WiiRemote\servoWii.cpp.o: In functiongetSteeringAngle()': C:\Documents and Settings\expressway\My Documents\Arduino\libraries\WiiRemote/servoWii.cpp:43: multiple definition of
getSteeringAngle()'
servoWii.cpp.o:C:\DOCUME~1\EXPRES~1\LOCALS~1\Temp\build8487534986814557710.tmp/servoWii.cpp:39: first defined here
WiiRemote\servoWii.cpp.o: In function__static_initialization_and_destruction_0': C:\Documents and Settings\expressway\My Documents\Arduino\libraries\WiiRemote/servoWii.cpp:67: multiple definition of
deg1'
servoWii.cpp.o:C:\DOCUME~1\EXPRES~1\LOCALS~1\Temp\build8487534986814557710.tmp/servoWii.cpp:63: first defined here
WiiRemote\servoWii.cpp.o: In functionmyapp()': C:\Documents and Settings\expressway\My Documents\Arduino\libraries\WiiRemote/servoWii.cpp:40: multiple definition of
myapp()'
servoWii.cpp.o:C:\DOCUME~1\EXPRES~1\LOCALS~1\Temp\build8487534986814557710.tmp/servoWii.cpp:36: first defined here
WiiRemote\servoWii.cpp.o: In functionloop': C:\Documents and Settings\expressway\My Documents\Arduino\libraries\WiiRemote/servoWii.cpp:34: multiple definition of
loop'
servoWii.cpp.o:C:\DOCUME~1\EXPRES~1\LOCALS~1\Temp\build8487534986814557710.tmp/servoWii.cpp:30: first defined here
WiiRemote\servoWii.cpp.o: In functionsetup': C:\Documents and Settings\expressway\My Documents\Arduino\libraries\WiiRemote/servoWii.cpp:27: multiple definition of
setup'
servoWii.cpp.o:C:\DOCUME~1\EXPRES~1\LOCALS~1\Temp\build8487534986814557710.tmp/servoWii.cpp:23: first defined here
WiiRemote\servoWii.cpp.o: In function__static_initialization_and_destruction_0': C:\Documents and Settings\expressway\My Documents\Arduino\libraries\WiiRemote/servoWii.cpp:67: multiple definition of
turn'
servoWii.cpp.o:C:\DOCUME~1\EXPRES~1\LOCALS~1\Temp\build8487534986814557710.tmp/servoWii.cpp:63: first defined here
servoWii.cpp.o: In function__static_initialization_and_destruction_0(int, int)': servoWii.cpp:(.text._Z41__static_initialization_and_destruction_0ii+0x10): undefined reference to
Servo::Servo()'
servoWii.cpp:(.text._Z41__static_initialization_and_destruction_0ii+0x18): undefined reference toServo::Servo()' servoWii.cpp.o: In function
getSteeringAngle()':
servoWii.cpp:(.text._Z16getSteeringAnglev+0xfa): undefined reference toServo::write(int)' servoWii.cpp:(.text._Z16getSteeringAnglev+0x10a): undefined reference to
Servo::write(int)'
servoWii.cpp.o: In functionsetup': servoWii.cpp:(.text.setup+0x10): undefined reference to
Servo::attach(int)'
servoWii.cpp:(.text.setup+0x1c): undefined reference toServo::attach(int)' WiiRemote\servoWii.cpp.o: In function
__static_initialization_and_destruction_0(int, int)':
servoWii.cpp:(.text._Z41__static_initialization_and_destruction_0ii+0x10): undefined reference toServo::Servo()' servoWii.cpp:(.text._Z41__static_initialization_and_destruction_0ii+0x18): undefined reference to
Servo::Servo()'
And here is the program
#include <WiiRemote.h>
#include <Servo.h>#define STEERING_ANGLE_MAX 180
#define STEERING_ANGLE_MIN 0
#define STEERING_ANGLE_CENTER 90
#define STEERING_ANGLE_STEP 5
Servo myservo; // create servo object to control a servo
Servo myservo1;
int deg1;
int turn;
WiiRemote wiiremote;void setup()
{wiiremote.init();
myservo.attach(6); // attaches the servo on pin 3 & 6 to the servo objects
myservo1.attach(3);}
void loop()
{
wiiremote.task(&myapp);}
void myapp(void) {
// if (wiiremote.buttonClicked(WIIREMOTE_TWO)) {
int steering_angle = getSteeringAngle();
}int getSteeringAngle(void) {
double rad; // y accel setup
double deg; // y accel setup
double rad2; // X accel setup
double deg2; // X accel setuprad = acos((double) wiiremote.Report.Accel.Y);
deg = rad * 180.0 / PI;rad2 = acos((double) wiiremote.Report.Accel.X);
deg2 = rad2 * 180.0 / PI;/* clipping */
if (deg > STEERING_ANGLE_MAX) { deg = STEERING_ANGLE_MAX; }
if (deg < STEERING_ANGLE_MIN) { deg = STEERING_ANGLE_MIN; }
if (deg2 > STEERING_ANGLE_MAX) { deg2 = STEERING_ANGLE_MAX; }
if (deg2 < STEERING_ANGLE_MIN) { deg2 = STEERING_ANGLE_MIN; }if (deg2 > 90) { deg1 = deg2 - 90; }
if (deg2 < 90) { deg1 = deg2 + 90; }myservo.write(deg2);
myservo1.write(deg1);}