|
Page 1 of 1
|
[ 6 posts ] |
|
Multiple buttons not working
| Author |
Message |
|
ttiwerp09
Rookie
Joined: Mon Nov 17, 2008 8:20 pm Posts: 3
|
 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! 
|
| Mon Nov 17, 2008 8:32 pm |
|
 |
|
Jeff McBride
Professor
Joined: Fri Sep 19, 2008 1:22 am Posts: 200
|
 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 |
|
 |
|
ttiwerp09
Rookie
Joined: Mon Nov 17, 2008 8:20 pm Posts: 3
|
 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!!! 
|
| Mon Nov 17, 2008 9:22 pm |
|
 |
|
david fort
Rookie
Joined: Sun Nov 16, 2008 3:07 pm Posts: 45
|
 Re: Multiple buttons not working
please see my diatribe here: viewtopic.php?f=33&t=785Good luck, David Fort Rockwell Automation
|
| Mon Nov 17, 2008 9:53 pm |
|
 |
|
ttiwerp09
Rookie
Joined: Mon Nov 17, 2008 8:20 pm Posts: 3
|
 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 |
|
 |
|
jyoungj
Rookie
Joined: Fri Oct 24, 2008 1:25 pm Posts: 14
|
 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 
_________________i poke you for information  plz help programer for norstar invention group
|
| Tue Nov 18, 2008 3:55 pm |
|
|
|
Page 1 of 1
|
[ 6 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 0 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
|
|