View unanswered posts | View active topics It is currently Wed Jul 23, 2014 4:39 am






Reply to topic  [ 1 post ] 
servos arnt working properly 
Author Message
Rookie

Joined: Tue Jan 13, 2009 12:24 pm
Posts: 10
Post servos arnt working properly
#pragma config(Servo, srvo_S4_C1_1, aim, tServoNormal)
#pragma config(Servo, srvo_S4_C1_2, trig, tServoNormal)
#include "JoystickDriver.c"
task main()
{
while (1==1)
{

// shooter controls

if(joy2Btn (6)) // load
{
motor[load] = -100;
}
if(joy2Btn (3)) // stop load
{
motor[load] = 0;
}
if(joy2Btn (2)) // load for shooting
{
motor[load] = -30;
}


if(joy2Btn (8)) // shoot
{
motor[shoot] = -100;
}
if(joy2Btn (4)) // shooter stop
{
motor[shoot] = -0;
}
if(joy2Btn(1)) // aim shooter
{
servo[aim] = 100;
servo[trig] = 10;
}
if(joy2Btn(7)) // trigger to hold balls
{
servo[trig] = 120;
servo[aim] =20;
}
}

this is the current configuration im stuck using because when i have only one servo programmed like this
while (1==1)
{
if(joy2Btn(1)) // aim shooter
{
servo[trig] = 120;
}
}
}
servo aim still responds and ive tried switching servo controllers, both are brand new and dont work idk if its the code or not. and just now when i try and configure the servos all of a sudden what ever i configure in motor and sensor setup doesnt get written, im having to copy the #pragma config(Servo, srvo_S4_C1_2, trig, tServoNormal) from another file.....


Wed Feb 24, 2010 1:11 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

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.