OCCRA
Go to Post I walked out to the area where the robot was getting ready to move, and there's no room near the robot. I look again, and realize it's all students. - rachakate [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-09-2010, 12:07 PM
interplanetary interplanetary is offline
Registered User
AKA: Camden
FRC #3168 (Warriors)
Team Role: Communications
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Suffolk, VA
Posts: 2
interplanetary is an unknown quantity at this point
Button programming help

My team is trying to program our joysticks to where the trigger button on a Logitech Attack 3 controller is used for throttle on our bot (like a throttle button on a video game) So if we hit the joystick and are not holding the trigger the bot won't move. I was wondering if anybody has the code or can tell us how to write the code to do this, help would be apperciated. we are using tank drive. We are using Java to program our robot.

Last edited by interplanetary : 02-09-2010 at 12:26 PM.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-09-2010, 12:21 PM
MattD's Avatar
MattD MattD is offline
Registered User
AKA: Matthew Douglas
FRC #0228 (GUS Robotics)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Indianapolis, IN
Posts: 185
MattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to behold
Send a message via AIM to MattD
Re: Button programming help

You can use the getTrigger() method on a Joystick to determine whether or not the button is being pressed. If it is, call the tankDrive() method, and if it isn't, tell the robot to stop driving. This could be done by calling drive() with 0.0 as the speed and curve values.

Example:
Code:
// Assumptions: these are already set up and configured.
RobotDrive drive;
Joystick leftStick, rightStick;

// In teleop control: 
if (rightStick.getTrigger())
    drive.tankDrive(leftStick, rightStick);  // Drive when trigger is pressed
else
    drive.drive(0.0, 0.0);          // Stop driving if trigger is released
__________________
GUS Robotics Team 228

2010 WPI Engineering Inspiration Award
2010 WPI Regional Champions (Thanks 230 & 20!)
2010 CT VEX Champions
2010 CT VEX Innovate Award
2009 QCC VEX Champions
2009 CT Motorola Quality Award
2007 CT J&J Sportsmanship Award
2006 CT Best Website Award
Reply With Quote
  #3   Spotlight this post!  
Unread 02-10-2010, 09:59 AM
joshholat joshholat is offline
Registered User
FRC #0930
 
Join Date: Jan 2010
Location: Mukwonago
Posts: 24
joshholat is an unknown quantity at this point
Re: Button programming help

Yup, that's about all you'd need. Just make sure you aren't destroying the gearboxes by like going full speed and then hitting the trigger to stop movement instantaneously.
Reply With Quote
  #4   Spotlight this post!  
Unread 02-17-2010, 01:01 PM
chris janney chris janney is offline
Registered User
FRC #3266
 
Join Date: Jan 2010
Location: eaton ohio
Posts: 46
chris janney is an unknown quantity at this point
Re: Button programming help

so would it be similar to do that with a pendulum style kicker. we are using springs and pistons to power to kicker
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Button Programming Error? pyr0b0y NI LabVIEW 5 04-06-2009 05:18 PM
Joystick Button Programming in Labview Help Needed domoarigato NI LabVIEW 11 01-28-2009 10:55 AM
Programming a joystick button... programmr Programming 2 01-05-2009 04:13 PM
button programming joesmomh00haha Programming 12 02-10-2007 10:36 AM
Joystick Button programming Bharat Nain Programming 5 02-18-2005 11:48 AM


All times are GMT -5. The time now is 09:58 PM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi