View unanswered posts | View active topics It is currently Sat Jul 26, 2014 2:10 pm






Reply to topic  [ 6 posts ] 
Multiple buttons not working 
Author Message
Rookie

Joined: Mon Nov 17, 2008 8:20 pm
Posts: 3
Post Multiple buttons not working
I have been working on this program for a while now, and it is starting to get really frusterating. I have watched the webinars like a million times and i still cant get more that the number one button on the controller to work. i copied the text from the webinar, and yet it still didn't work. I have tried several different things and none of them work. Is there any way someone could give me the actuall name of the button, then i could refer the progam directly to the button rather than using a variable? This would help tons. We have more than one servo to use and no program to go with it. Thanks! :programmer:


Mon Nov 17, 2008 8:32 pm
Profile
Professor

Joined: Fri Sep 19, 2008 1:22 am
Posts: 200
Post Re: Multiple buttons not working
Please post the code that you have have if you want someone to help you figure out what is wrong with it.

_________________
Jeff McBride
Benson Robotics Club


Mon Nov 17, 2008 8:37 pm
Profile
Rookie

Joined: Mon Nov 17, 2008 8:20 pm
Posts: 3
Post Re: Multiple buttons not working
Here is the code that i have come up with.

#pragma config(Hubs, S1, HTMotor, HTServo, none, none)
#pragma config(Motor, mtr_S1_C1_1, , tmotorNone, openLoop)
#pragma config(Motor, mtr_S1_C1_2, , tmotorNone, openLoop)
#pragma config(Servo, servo1, arm, tServoNormal)
#pragma config(Servo, servo2, elbo, tServoNormal)


#include "JoystickDriver.c"

task main()
{
servoChangeRate[servo1] = 2;
servoChangeRate[servo2] = 3;
while(true)
{
getJoystickSettings(joystick);

if(joy1Btn(1) != 0)
{
servoTarget[servo1] = 115; servoTarget[servo2] = 120;
}
if(joy1btn(2) != 0)
{
servoTarget[servo1] = 50; servoTarget[servo2] = 0;
}

}


}


help!!! :breakcomputer: :breakcomputer:


Mon Nov 17, 2008 9:22 pm
Profile
Rookie

Joined: Sun Nov 16, 2008 3:07 pm
Posts: 45
Post Re: Multiple buttons not working
please see my diatribe here: viewtopic.php?f=33&t=785

Good luck,
David Fort
Rockwell Automation


Mon Nov 17, 2008 9:53 pm
Profile
Rookie

Joined: Mon Nov 17, 2008 8:20 pm
Posts: 3
Post Re: Multiple buttons not working
What does the TJoystick joystick; command do? i saw it in the link above, and did not recognize it.


Tue Nov 18, 2008 12:04 am
Profile
Rookie

Joined: Fri Oct 24, 2008 1:25 pm
Posts: 14
Post Re: Multiple buttons not working
i have goten buttens to work and i did not need the != 0 or is that part of the new robotc(4.46) :?:
if not then try it with out the != 0 :D

_________________
i poke you for information :poke: plz help
programer for norstar invention group


Tue Nov 18, 2008 3:55 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 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.