|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Logitech Dual Action Setup for 2 Axis help please?
Hey, im kinda new to FRC java and i need assitance in making a basic drive program that will work 2 joysticks on 1 controller. How would i set it up correctly?
|
|
#2
|
|||||
|
|||||
|
Re: Logitech Dual Action Setup for 2 Axis help please?
|
|
#3
|
||||
|
||||
|
Re: Logitech Dual Action Setup for 2 Axis help please?
You just declare it like any ordinary joystick, and read each axis from each joystick independantly. One stick will be axis 1 and 2, the other will be 3 and 4 (Unless there are other analog inputs). Also, make sure the DS has the proper drivers!
|
|
#4
|
||||
|
||||
|
Re: Logitech Dual Action Setup for 2 Axis help please?
alright, but how would i declare it? This is the way i thought it could work itself :
Joystick joy1 = new Joystick(1); But, how would i refer to the axis number that i desire and not have it get a heart attack (stay away literal types (⌐_⌐v) |
|
#5
|
|||||
|
|||||
|
Re: Logitech Dual Action Setup for 2 Axis help please?
Quote:
|
|
#6
|
||||
|
||||
|
Re: Logitech Dual Action Setup for 2 Axis help please?
Quote:
Code:
joy1.getRawAxis(1) |
|
#7
|
|||
|
|||
|
Re: Logitech Dual Action Setup for 2 Axis help please?
We just modified last years code yesterday to get this working. We found axis mapping to be
Axis indexes: 1 - Left joystick X 2 - Left joystick Y 3 - Right joystick X 4 - Right joystick Y 5 - DPad x 6 - DPad y to stay with tank drive and use both joysticks from one game pad plugged into USB port 1, the code looked like in the constructor m_driveStick = new Joystick(1); in the teleop section m_robotDrive.tankDrive(m_driveStick, 4, m_driveStick, 2); where 4 and 2 are the axis numbers assigned to the left and right joystick arguments. wjb |
|
#8
|
||||
|
||||
|
Re: Logitech Dual Action Setup for 2 Axis help please?
in these examples what would have to be imported in order for these to be used?
|
|
#9
|
|||||
|
|||||
|
Re: Logitech Dual Action Setup for 2 Axis help please?
Quote:
Code:
import edu.wpi.first.wpilibj.*; Code:
import edu.wpi.first.wpilibj.Joystick; |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|