![]() |
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?
|
Re: Logitech Dual Action Setup for 2 Axis help please?
|
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!
|
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) |
Re: Logitech Dual Action Setup for 2 Axis help please?
Quote:
|
Re: Logitech Dual Action Setup for 2 Axis help please?
Quote:
Code:
joy1.getRawAxis(1) |
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 |
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?
|
Re: Logitech Dual Action Setup for 2 Axis help please?
Quote:
Code:
import edu.wpi.first.wpilibj.*;Code:
import edu.wpi.first.wpilibj.Joystick; |
| All times are GMT -5. The time now is 10:39. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi