View unanswered posts | View active topics It is currently Mon Dec 22, 2014 8:24 am






Reply to topic  [ 5 posts ] 
6 servos 
Author Message
Rookie

Joined: Thu May 17, 2012 3:35 pm
Posts: 36
Post 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.


Sat Dec 15, 2012 1:54 pm
Profile
Novice

Joined: Sun Oct 21, 2012 10:01 pm
Posts: 76
Post 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!


Sat Dec 15, 2012 2:31 pm
Profile
Rookie

Joined: Thu May 17, 2012 3:35 pm
Posts: 36
Post 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


Sat Dec 15, 2012 3:17 pm
Profile
Novice

Joined: Sun Oct 21, 2012 10:01 pm
Posts: 76
Post 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?


Sat Dec 15, 2012 3:59 pm
Profile
Rookie

Joined: Thu May 17, 2012 3:35 pm
Posts: 36
Post Re: 6 servos
Thanks, yes I use 3.50 . Then I updated to 3.54. Now it works.


Sat Dec 15, 2012 5:36 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.