ROBOTC.net forums
http://www.robotc.net/forums/

6 servos
http://www.robotc.net/forums/viewtopic.php?f=1&t=5264
Page 1 of 1

Author:  balu2012 [ Sat Dec 15, 2012 1:54 pm ]
Post subject:  6 servos

Hello

I try to build a quadropod with Tetrix.

But the Servo at Port 6 has an error.

Image

What does this mean?

Thanks.

Author:  amcerbu [ Sat Dec 15, 2012 2:31 pm ]
Post subject:  Re: 6 servos

Check your program to make sure you're not sending a value to the servo that's greater than 255 or less than 0. You get similar errors for sending motors values greater than 100 or less than -100. If you post your code on the forum using the [code] and [/code] tags, maybe we can help diagnose the problem! Good luck!

Author:  balu2012 [ Sat Dec 15, 2012 3:17 pm ]
Post subject:  Re: 6 servos

Here is the code:

Code:
#pragma config(Hubs,  S1, HTMotor,  HTServo,  none,     none)
#pragma config(Sensor, S1,     ,               sensorI2CMuxController)
#pragma config(Servo,  srvo_S1_C2_1,    servo1,               tServoStandard)
#pragma config(Servo,  srvo_S1_C2_2,    servo2,               tServoStandard)
#pragma config(Servo,  srvo_S1_C2_3,    servo3,               tServoStandard)
#pragma config(Servo,  srvo_S1_C2_4,    servo4,               tServoStandard)
#pragma config(Servo,  srvo_S1_C2_5,    servo5,               tServoStandard)
#pragma config(Servo,  srvo_S1_C2_6,    servo6,               tServoStandard)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

void initializeRobot();
void rechtsaussen();
void rechtsmitte();
void rechtsinnen();

void linksaussen();
void linksmitte();
void linksinnen();
/**************************************************/
void initializeRobot()
{

servo[servo1] = 130; // Startpostion
servo[servo2] = 60; // Startpostion
servo[servo3] = 80; // Startpostion
servo[servo4] = 80; // Startpostion
servo[servo5] = 60; // Startpostion
servo[servo6] = 130; // Startpostion

wait1Msec(1000); // warten
return;
}
/**************************************************/
 void rechtsaussen()
{
    int delta = 3;
  servoChangeRate[servo1] = delta;
  servo[servo1] = 130;

}
/**************************************************/
 void rechtsmitte()
{
    int delta = 3;
  servoChangeRate[servo2] = delta;
  servo[servo2] = 60;

}
/**************************************************/
 void rechtsinnen()
{
    int delta = 3;
  servoChangeRate[servo3] = delta;
  servo[servo3] = 80;

}
/**************************************************/

/**************************************************/
 void linksaussen()
{
    int delta = 3;
  servoChangeRate[servo6] = delta;
  servo[servo6] = 130;

}
/**************************************************/
 void linksmitte()
{
    int delta = 3;
  servoChangeRate[servo5] = delta;
  servo[servo5] = 60;

}
/**************************************************/
 void linksinnen()
{
    int delta = 3;
  servoChangeRate[servo4] = delta;
  servo[servo4] = 80;

}
/**************************************************/



task main()
{

initializeRobot();
wait1Msec(100);
rechtsinnen();
wait1Msec(100);
rechtsmitte();
wait1Msec(100);
rechtsaussen();
wait1Msec(100);

linksaussen();
wait1Msec(100);
linksmitte();
wait1Msec(100);
linksinnen();
wait1Msec(100);


}


???

The code is o.k., but there is this error

Author:  amcerbu [ Sat Dec 15, 2012 3:59 pm ]
Post subject:  Re: 6 servos

Yeah, the code looks fine to me. What happens if you remove the assignments to the servoChangeRate[] array? Do you still get an error? Also, what version of RobotC are you using?

Author:  balu2012 [ Sat Dec 15, 2012 5:36 pm ]
Post subject:  Re: 6 servos

Thanks, yes I use 3.50 . Then I updated to 3.54. Now it works.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/