Error Compiling w/new libraries

Hi folks! I just got my robot arm project to use a wii nunchuk for control! All was going well until I nicked my kitchen table. That's when I decided I needed slower/smoother servo movements. Excuse me for being a n00b though, I have a hard time with this programming stuff :S. I have an issue with compiling the program. I think the problem lies in the new library I installed. I replaced the servo library with the VarSpeedServo library for smoother movements. I haven't put in any of the new code yet. If someone could lend me a hand that would be spectacular! Thank you so much folks!

#include <VarSpeedServo.h>
#include <Wire.h>
#include "nunchuck_funcs.h"

#define ROTATION_SERVO   3
#define VERTICAL_SERVO1  9
#define VERTICAL_SERVO2  5
#define ROTATION_PINCE   6
#define POWER_PINCE     10
#define VITESSE  2

byte accx,accy,joyy,joyx,cbut,zbut;

VarSpeedServo servo_1, servo_2, servo_3, servo_4, servo_5;

void setup()
{
    Serial.begin(19200);
    nunchuck_setpowerpins();
    nunchuck_init(); // send the initilization handshake
    Serial.print("WiiChuckDemo ready\n");
       
    servo_1.attach(ROTATION_SERVO);
    servo_2.attach(VERTICAL_SERVO1);
    servo_3.attach(VERTICAL_SERVO2);
    servo_4.attach(ROTATION_PINCE);
    servo_5.attach(POWER_PINCE);
        
    servo_1.write(90);
    servo_2.write(60);
    servo_3.write(90);
    servo_4.write(170);
    servo_5.write(180);
}

void loop()
{
        

        nunchuck_get_data();

        accx = nunchuck_accelx(); // ranges from approx 70 - 182
        accy = nunchuck_accely(); // ranges from approx 65 - 173
        joyy = nunchuck_joyy();
        joyx = nunchuck_joyx();
        cbut = nunchuck_cbutton();
        zbut = nunchuck_zbutton();

        
        if(joyx > 200)  servo_1.write(constrain(servo_1.read()-VITESSE,0,180));
        if(joyx < 50)   servo_1.write(constrain(servo_1.read()+VITESSE,0,180));
        if(joyy < 200)  servo_2.write(constrain(servo_2.read()+VITESSE,60,180));        //swap
        if(joyy > 50)   servo_2.write(constrain(servo_2.read()-VITESSE,60,180));         //swap
        if(accy < 170)  servo_3.write(constrain(servo_3.read()-VITESSE,100,180));     //Changed here from > to <
        if(accy > 110)  servo_3.write(constrain(servo_3.read()+VITESSE,100,180));    //Changed here from < to >
        if(accx > 150)  servo_4.write(constrain(servo_4.read()+VITESSE,0,180));                 //not used
        if(accx < 80)   servo_4.write(constrain(servo_4.read()-VITESSE,0,180));                    //not used
        
        if(cbut == 1)   servo_5.write(constrain(servo_5.read()+VITESSE, 50, 180));         //CHANGED
        if(zbut == 1)   servo_5.write(constrain(servo_5.read()-VITESSE, 50, 180));         //CHANGED
        
        
        //nunchuck_print_data();
        Serial.print("Servo : ");
        Serial.println(servo_5.read());
        
        delay(10);
}

Different libraries require different function calls etc... There should be documentation on how to use it.

Reading the header file is frequently a good source (no pun...) of information about the library or class you wish to use... Highly Recommended.

Bob

If someone could lend me a hand that would be spectacular!

If someone could tell us what the problem is, the would be spectacular, too.

It seems like the new VarSpeedservo library has an issue with almost all of it's varibles. I get an error (for example): Arduino\libraries\VarSpeedServo\VarSpeedServo.cpp:91: error: 'LOW' was not declared in this scope.

I get an error (for example): Arduino\libraries\VarSpeedServo\VarSpeedServo.cpp:91: error: 'LOW' was not declared in this scope.

I'm going to go out on a limb and guess that VarSpeedServo.h or VarSpeedServo.cpp is trying to include WProgram.h, where those variables/values used to be defined.

Thanks man! I just started to figure it out myself :blush: But I REALLY appreciate the help!